Digital Coding4
Digital Coding4
Melegrito, PECE
Objective
Example 1:
Given bit 0110 can be interpreted by the weights as:
(0 x 8) + (1 x 4) + (1 x 2) + (0 x 1)
4 + 2 = 6 (decimal)
Example 2:
Write the decimal number 369 in BCD
Example 3:
Find the equivalent decimal number for the BCD
0001010001110101
Excess of 3 (Excess -3)
Unweighted code, its code assignment is
obtained from the corresponding value of BCD after
the addition of 3.
Example 4:
Example 5:
0110 can be interpreted as:
(0 x 8) + (1 x 4) +{ [1 x (- 2)] +[0 x (-1)]}
4–2=2
210 = 0110 (84-2-1)
Example 6:
0111 convert to 84 -2 -1 code
2 4 2 1 Code
Example 7:
Convert BCD 0001 to 2421 code
Example 8:
Convert BCD 0101 to 2421 code
Example 9:
Convert BCD 0111 to 2421 code
Error Detection Codes
➢ Codes used to detect errors during transmission.
1 1 0 0 0 0 1 1 1 1 0 0 1 0 0 1
Example 2: EBCDIC
2 Characters: 1 Character = 8 bits
1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 1
Processor Unit
8 Cells 8 Cells 8 Cells 8 Cells
Processor Register
0 0 0 1 0 0 0 0 1 0 R1
R3
Digital Logic circuit for
binary addition 0 1 0 0 1 0 0 0 1 1
0 0 1 1 1 0 0 0 0 1 R2 Processor Unit
Assignment #4
Binary Logic
Activity #4
1. Represent the decimal number 8620 (a) in BCD,
(b) in excess- 3 code, © in 2, 4, 2, 1 code and (d)
as a binary number.
2. Obtain the weighted code for the base- 12 digits
using weights of 5421.
3. The state of a 12-cell register is 010110010111.
What is its content if it represents (a) three decimal
digits in BCD, (b) three decimal digits in excess-3
code, (c) three decimal digits in 2, 4, 2, 1 code.