2-Binary Codes and Binary Logic
2-Binary Codes and Binary Logic
LECTURE 3
BINARY CODES AND BINARY
LOGIC
Outline
• Binary codes
• Logic operations
• Logic gates
• Boolean functions
Weighted & non-weighted codes
See https://www.tutorialspoint.com/what-is-excess-3-code
for more info on excess-3 codes
Gray code
Digit Binary Gray Code
0 0000 0000
1 0001 0001 • Gray code is not a number
2 0010 0011 system.
3 0011 0010 • It is an alternate way to
4 0100 0110
represent four bit data
5 0101 0111
6 0110 0101 • Only one bit changes from
7 0111 0100 one decimal digit to the
8 1000 1100 next
9 1001 1101
10 1010 1111 • Useful for reducing errors
11 1011 1110 in communication.
12 1100 1010 • Can be scaled to larger
13 1101 1011
numbers.
14 1110 1001
15 1111 1000
ASCII Code
0 1
A Y
1 0
Symbol
Input Output
• The functionality can be represented with truth tables.
• Truth table completely specifies outputs for all input
combinations.
• NOT gate (or inverter):
• An input of 0 is inverted to a 1.
• An input of 1 is inverted to a 0.
• Logic operation: A’=Y (or 𝐴ҧ = 𝑌), ‘not A is equal to Y’
AND gate
A
Y
B
1 1 1
OR gate
A
Y
B
1, or both of 0 0 0
them are, the output 0 1 1
will be 1. 1 0 1
1 1 1
Gate with multiple
inputs
3 Input OR Gate
Example: Alarm system with use of OR
gate
Ordering Boolean Functions
• Binary codes
• Logic operations
• Logic gates
• Boolean functions