0% found this document useful (0 votes)
4 views

Digital Coding4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Digital Coding4

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Mark P.

Melegrito, PECE
Objective

➢Identify the use and application of


different binary codes in digital
system.
Digital Coding
Digital Coding – A complete group of combinations of
numbers, letters or symbols is called a digital code.

1. Binary Codes- Electronic digital systems use signals


that have two distinct values and circuit elements that
have two stable states. There is a direct analogy
among binary signals, binary circuit elements, binary
digits. A binary number of n digits, for example may be
represented by n binary circuit elements, each having
an output signal equivalent to a 0 or a 1. Digital system
represent and manipulate not only binary numbers, but
also other discrete elements of information.
2. Decimal Codes
Decimal Digit BCD (8421) Excess- 3 8 4 -2 -1 2421
0 0000 0011 0000 0000
1 0001 0100 0111 0001
2 0010 0101 0110 0010
3 0011 0110 0101 0011
4 0100 0111 0100 0100
5 0101 1000 1011 1011
6 0110 1001 1010 1100
7 0111 1010 1001 1101
8 1000 1011 1000 1110
9 1001 1100 1111 1111

Binary Codes for the


Decimal Digits
Binary Coded Decimal (BCD)
Each decimal digit is represented by a group of four
bits. Weighting of the 4-bit position is 8 4 2 1, hence it is
also called 8421 code.

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:

Decimal BCD Excess -3


0 0000 0011
1 0001 0100
2 0010 0101
8, 4, - 2, - 1 Code
Assign negative weights to a decimal codes.

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.

➢ A parity bit is an extra bit included with a message to


make the total number of 1’s either odd or even.
(a) Message P (odd) (b) Message P (even)
0000 1 0000 0
0001 0 0001 1
0010 0 0010 1
0011 1 0011 0
0100 0 0100 1
0101 1 0101 0
0110 1 0110 0
0111 0 0111 1
1000 0 1000 1
1001 1 1001 0
1010 1 1010 0
1011 0 1011 1
1100 1 1100 0
1101 0 1101 1
1110 0 1110 1
1111 1 1111 0
Reflected Code
➢To obtain the reflected code, one can start
with any bit combination and proceed to
obtain the next bit combination by
changing only one bit from 0 to 1 or 1 to 0
in any desired random fashion, as long as
two numbers do not have identical code
assignments. The reflected code is also
known as the Gray Code.
Reflected Code Decimal Equivalent
0000 0
0001 1
0011 2
0010 3
0110 4
0111 5
0101 6
0100 7
1100 8
1101 9
1111 10
1110 11
1010 12
1011 13
1001 14
1000 15
Alphanumeric Codes
➢ Is a binary code of a group of elements consisting of
10 decimal digits, the 26 letters of the alphabet, and
a certain number of special symbols such as $. The
total number of elements in an alphanumeric code is
greater than 36.
➢ ASCII ( American Standard Code for Information
Interchange) – a 7 bits code
➢ EBCDIC (Extended Binary Coded Decimal
Interchange Code) – an 8 bits code
Binary Storage and Registers
Binary Cell- is a device that possesses two stable
states and is capable of storing one bit of information.
- 1 cell stores 1 bit
Registers- a group of binary cells.
Example 1: 16- cell register

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

8 bits = 1 byte; 4 bits = 1 nibble


Register Transfer
Memory Unit J O H N
Memory
010010111 01001111 11001000 11001110
Registers

Processor Unit
8 Cells 8 Cells 8 Cells 8 Cells

Processor Register

Input Teletype Unit 8 Cells


Keyboard J Control
O
Input
H Registers
N
Binary Information Processing
Memory Unit Sum
0 0 0 0 0 0 0 0 0 0
Operand 1
0 0 1 1 1 0 0 0 0 1
Operand 2
0 0 0 1 0 0 0 0 1 0

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.

You might also like