Lec 2 Binary Codes
Lec 2 Binary Codes
Lec 2 Binary Codes
-American
-Extended
Standard
Binary
Code
Coded
for
Information
Decimal
Interchange
Interchange
Code
A
010 001
B
010 010
C
010 011
D
010 100
E
010 101
F
010 110
G 010 111
H
011 000
I
011 001
J
100 001
100
100
100
100
100
100
100
100
100
100
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
8-bit EBCDIC
1100
1100
1100
1100
1100
1100
1100
1100
1100
1101
0001
0010
0011
0100
0101
0110
0111
1000
1001
0001
12.1
12.2
12.3
12.4
12.5
12.6
12.7
12.8
12.9
11.1
ASCII
7-bit
Codes
Character
ASCII Code
Character
ASCII Code
@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
|
NULL
HORIZ TAB
LINE FEED
VERT TAB
1000000
1000001
1000010
1000011
1000100
1000101
1000110
1000111
1001000
1001001
1001010
1001011
1001100
1001101
1001110
1001111
1010000
1010001
1010010
1010011
1010100
1010101
1010110
1010111
1011000
1011001
1011010
1011011
1011100
1011101
1011110
0000000
0001001
0001010
0001011
FORM FEED
CARRIAGE RETURN
RUBOUT
SPACE
!
"
#
$
%
&
'
(
)
*
+
,
.
/
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?
0001100
0001101
1111111
0100000
0100001
0100010
0100011
0100100
0100101
0100110
0100111
0101000
0101001
0101010
0101011
0101100
0101101
0101110
0101111
0110000
0110001
0110010
0110011
0110100
0110101
0110110
0110111
0111000
0111001
0111010
0111011
0111100
0111101
0111110
0111111
8421
(BCD)
6311
Excess-3
2-out-of-5
Gray
0000
0000
0011
00011
0000
0001
0001
0100
00101
0001
0010
0011
0101
00110
0011
0011
0100
0110
01001
0010
0100
0101
0111
01010
0110
0101
0111
1000
01100
1110
0110
1000
1001
10001
1010
0111
1001
1010
10010
1011
1000
1011
1011
10100
1001
1001
1100
1100
11000
1000
1
10
11
12
13
0
14
15
16
9096
In excess-3 code:
In BCD code:
CI
???
Meaningless, why???
Boolean Algebra
Boolean Algebra
Deals with manipulation of Variables & Constants
Boolean Variables, such as X, Y, Z, A, B, C, etc. can have
"values" of either 0 or 1.
0 & 1 are constants & are symbols only, representing two
different states of a quantity.
i.e.
F or T
Low voltage or high voltage, usually written L or H
Flow or now flow
0V logical 0
e.g.
+5V logical 1
or
0V 1
+5V 0
+ ve
logic
- ve
logic
Basic Operations
NOT (compliment or invert)
AND
OR
Not 1 is written as:
1 or 1
Only 3
e.g.
Not :
X and Y
X or Y
1 or X
:
:
:
X or X
X Y
X + Y
1 + X
X'
C = X
OR
A
B
A
B
C=A B
+
C=A+B
e.g.
Characteristics of
if X = 0 C = 1
an Inverter
if X = 1 C = 0
Truth Table
X
C
0
A
B
AND gate
C = A B
0
0
1
1
0
1
0
1
0
0
0
1
OR gate
C = A+ B
Logical
Multiplication
A
B
Logical
Addition