Saturday, 15 August 2015

Does computer memory record the zero binary state?


It's been two years since I started reading about electronics and computer circuits. I fell in love with the homemade computers and the possibility of building one by myself. You will see: When somebody explains computer memory, says "There is, and there isn't" "There's Voltage (1) or there isn't voltage (0)"


Is there a way computers record the zero state? (If it's with different voltages, how do they recognize it)


For example, if I want to create a serial paper tape I'm going to put a hole where there's a one, and I'm not going to do so when there's a zero. But my computer will not recognize that "lack of hole" as a zero, and when reading:


If the original signal is: 1010


Then in the tape it's: 1(Nothing)1(Nothing)


Wich turns out on the final data as: 11 (That is, not correct)


I know that computers use something like timing or control signals whether must be data or not. Can someone explain me that?


Thanks by now.



PD: I don't know if it's the best forum. But since my question is about the electronic way computers read and write data, I decided to post here. Don't kill me, please T.T!!



Answer




If the original signal is 1010 then in the tape it's 1 (Nothing) 1 (Nothing) which turns out on the final data as 11. (That is, not correct.)



You have spotted the problem with basic binary serial transmission. There are two common ways around this:



  • Send a separate clock pulse alongside the data. In your paper tape example it would mean punching a second line of holes, one per bit. Now we monitor both lines of holes and the 'clock' holes tell us when to look for a data hole. If we find one we record a '1' and if we don't we record a '0'. This scheme is called synchronous data transmission.


enter image description here



Figure 1. Asynchronous serial data transmission. Source: Wikipedia.



  • Agree a data rate (see baud rate). In this scheme we both agree that the '1's and '0's are going to be a certain distance or time apart. On your paper tape that might be a 3 mm pitch. All that is required is to start the machine up, punch one hole for a 'start' bit and then punch or not punch subsequent bits according to the data pattern. A problem with this is that any error in the feed rate will accumulate and the timing will go off. To get around this a start-bit is transmitted every so often. For RS232, for example, the data is broken up into 7 or 8-bit words and each is preceded with a start bit ('1') and terminated with one or two stop bits ('0'). This allows the receiver to retrain. This method is called asynchronous transmission.


A further note that may help your understanding: When the start bit is received the receiver will wait one and a half cycles and start sampling in the centre of the subsequent bits. That way if the clocks are slightly fast or slow the sampling should be still within the bit width and allow accurate data recovery.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...