|
|
Binary SystemWhen you say binary representation, what exactly do you mean?The number system we currently use is decimal or base 10 system. We use 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 to represent all numbers. The position of the number is important in determining the value of the number. In binary system we use 0, 1 to represent all the numbers. Also, the binary representation is positional. The table lists the binary numbers upto 10.
If you represent 1 by 5 Volts and 0 by 0 Volts, which correspond to on and off, how do you represent negative numbers? Two main ways used to represent negative numbers are: Sign-Magnitude system reserves the most significant bit (far left) to represent the sign of number; means positive, and 1 means negative. Example:      0 1011011 = +91 This system is not generally used because it wastes the one bit, and hard to implement in hardware. Before you explain the other system, why is it called 2's Complement? And how and was the system arrived at? Twos complement system the most significant number (far left) also represents the sign. But to get the magnitude of a negative number, you have to consider the value of the 2'complement of the rest of the digits. To find the 2's complement, just flip; 0 to 1 and 1 to 0 and add 1. Example:      0 10010 = +18        0 means positive, its just +18 To take 2's complement, flip (which gives you 1's complement) the magnitude part, and then add 1. 10001 + 1 = 10010 = 18 Please, note a special case in 2's complement that is when sign bit or most significant bit is 1 and all the rest are zero then the decimal value of the 2's complement is equal to the magnitude part raised to the exponent of 2. That is: 2^(number of digits in the magnitude). But how exactly do we translate on and off into performing calculations? You know that we can implement NOR, AND, OR, and NOT from switches. Then we just use Boolean algebra to extend the calculations. No, I do not know how we can implement the logic gates from switches, and what are logic gates? (Continueous Question) |