Professional Documents
Culture Documents
In digital electronics how information is represented is key and there are different
radices, i.e. number bases, that a numbering system can use, with the most common
ones being:
• binary (base-2),
• octal (base-8),
• decimal (base 10) and
• hexadecimal (base 16).
When a reference is made to a numbering system's base, i.e. its' radix, the base
number represents the number of digits used in that numbering system. As an
example, we are all familiar with the decimal numbering system and the digits used it
are: 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9. The numbering systems that have a base/radix less
than 10 recycle the "digits" used to be common with the decimal numbering system.
Therefore the digits for binary are: 0 and 1, the digits for octal are: 0, 1, 2, 3, 4, 5, 6
and 7. For the hexadecimal numbering system, base 16, the digits are: 0, 1, 2, 3, 4, 5,
6, 7, 8, 9, A, B, C, D, E, F.
The decimal numbering is obviously linked to the fact that us humans have 10
fingers...10 digits. However, the other "common" numbering systems in digital
electronics are linked to logic, in particularly boolean logic and boolean algebra as
developed by George Boole. In logic, including the philosophical kind, there can only
be two answers: TRUE or FALSE. In digital electronics, we can represent TRUE as a high
voltage (historically 5 Volts, but it has changed to save power) which we denote as a 1
and we represent FALSE as low voltage (0 Volts, but lower voltages can also be used
too) which we denote as a 0. Therefore with two values to work with we then have
the binary numbering system. The octal numbering is simply a more compact group of
three binary digits. So instead of having to type "101" we can just type "5"; assuming
that the numbering system is known to be octal based. In a similar manner,
hexadecimal based numbering system is based on a grouping of four binary digits, so
"D" is easier to type instead of "1101"
Arithmetic Operations with Signed numbers:
Gray code
Binary-to-Gray Conversion:
Gray-to-Binary Conversion:
Circuit for Binary-to-Gray Conversion:
Circuit for Gray-to-Binary Conversion:
Excess-3 Code
Excess-3 code is an example of unweighted code. Excess-3 equivalent of a decimal
number is obtained by adding 3 and then converting it to a 4 bit binary format. For
instance to find excess-3 representation of decimal number 4, first 3 is added to 4 to
get 7 and then binary equivalent of 7 i.e. 0111 forms the excess-3 equivalent.
Six invalid combinations in excess-3 codes are: 0000, 0001, 0010, 1101, 1110, 1111.
Examples:
Steps:
Step 1 -- Convert the binary number to decimal.
Step 2 -- Convert decimal number to BCD.
Calculating BCD Equivalent. Convert each digit into groups of four binary digits
equivalent.
Result
(11101)2 = (00101001)BCD
BCD to Binary Conversion
Steps
Calculating Decimal Equivalent. Convert each four digit into a group and get decimal
equivalent or each group.
Result
(00101001)BCD = (11101)2
BCD to Excess-3
Steps
Step 1 -- Convert BCD to decimal.
Step 2 -- Add (3)10 to this decimal number.
Step 3 -- Convert into binary to get excess-3 code.
Result
(1001)BCD = (1100)XS-3
Excess-3 to BCD Conversion
Steps
Step 1 -- Subtract (0011)2 from each 4 bit of excess-3 digit to obtain the
corresponding BCD code.
Result
(10011010)XS-3 = (01100111)BCD
Reference: