Title: www.cs.huji.ac.il/~dlocs
1"????? ??????? ???????"
- ??? ?????
- www.cs.huji.ac.il/dlocs
- ?????? ??? news-groups
- ????? ?????? ??????? ?? Morris Mano (????? 20
??????) - ???? ?"? ???? ?????.
- ???? ???? ????? 1600-1400 Ross 76
- ??????? ???? ????
- ???? ?????
- ???? ???????
- ?????? ???????? ???? ???? ?????? 5?2
- ??????? ??????? ??? ??? ??? ?????
2????? ??????? ???????
- Reference book
- Computer engineering hardware design by
Morris Mano, Prentice Hall - Digital Design by Morris Mano Prentice Hall
- ??????
- ????? ??????? ????????
- ?????? ??????? ?????? ????????
- ????? ???????? ?????????
- ?????? ???????
- ?????? ??????
- ?????? ??????
- ?????? ???????
- ???? ?????? ??????? ?????
- ????? ????? ?????????
- ?????? ????? ?????? ?????
Binary Numbers and Codes Digital Circuits
Boolean Algebra Analysis of boolean
systems Decoders, Encoders, Mutiplexers Sequential
Logic Filp-Flops (???????) Registers and
counters Memory Unit Register transfer and
computer organization Control until Computer
instructions and addressing modes
???? ?????
3???? ???? ????? ?????
???? ??? ?????? ?????? ??????? ???????? ?????
????? ??????. ???? ????????? ????? ???????
Turing Machine
CPU Central Processing Unit
Processor Unit ????? ????????
Control Unit ????? ????
memory bus
Memory Unit ????? ??????
I/O bus
Output Devices
Input Devices
- ?????? ?????? ?????
- Data flow Machines
- Quantum Computation
- Specialized Hardware
- Optical Computers
4????? ?????? ?????
????
???? r
???
???? radix
?????
22
5???? ??? ??????
???? ??????? "???????" ? ri
X / r ?X(1) , S(1) ?????
X ?
X mod r
X(1)/r ?X(2) , S(2) ?????
???? ?????
X(2)/r ?X(3) , S(3) ?????
???
??????
)S(n)S(n-1)S(2)S(1))r
?????
35/2 ? (17,1)
(35)10 ?(?)2
a0
17/2 ? (8,1)
a1
8/2 ? (4,0)
a2
(100011)2
4/2 ? (2,0)
a3
252423222120
2/2 ? (1,0)
a4
1/2 ? (0,1)
a5
????!
6- ?????? ?????? ????? ??? ??????? ??????????
???????? ???? ???? ????????. - ????? ????? ?????? ????? ??? (???"? ??????) ????
????? ???? ??????. - ?????? ?????? ????? ???? ????? ????????
Octal (8), Hexadecimal (16)
07
09ABCDEF
10 11 12 13 14 15
????? ??????? ?????? ?? ???????? ???? ???? ??????
?"? ?????
100 010 111.001 000 110 111
( 4 2 7 . 1 0 6 7 )8
0011 1001 1100.0001 1000 1010
( 3 9 C . 1 8 A )16
? ??? ????? "???" ? - Boot programs ????? ??????
?"????".
7????? ??????
(???? r)
C2
C1
O1(a1b1) mod r C1 1 iff a1 b1 ? r (0
otherwise) ai?0,1,,r-1 bi?0,1,,r-1 Oi(aib
ici-1) mod r Ci(aibici-1)?r
??????
?
8????? ?????? ????????
C2
C1
On
Cn
??? ????
ai?0,1 bi ? 0,1 oi?0,1 ci ? 0,1
Oi (ai bi ci-1( mod 2 ci-1, bi, ai??????
??
Ci
????? ?????? ????? ?????? ?????? "????" ?"?
?????? ???????.
9?????? ?? ?????? ??????? ????? ?"? ???? ?????
S
???? n ?????
????
S0 ? ????? ????? X (n ???? ?????) S1 ?
????? ????? -X
????? n2
???????
???????
0 000 1 001 2 010 3 011
0- 100 1- 101 2- 110 3- 111
- ????? ???? ? 0.
- ??? ???? ?????? ?????????.
- ??????? ?????? ?? ?????? ?????? ?????? ???
(floating point) - ????? ???? ????? (exponent).
10?????? ?? ?????? ???????
???? ????? ?????? ??????? ????? ???? ?????? ?????
?"? ????? ?????? ?? ????.
????? ? ????? ??????
????? II
X - Y X (-Y) X (N - Y) - N
????? III
????? I
- ??? ????? ? N
- ??? ?????
- ???? N ????? ?????? ??????.
?????? ??? N ?? ?????? ?????? ??? ????? N ????
???? ???? ??????.
????? ???? ????? 2
???? ???? ?? n ?????? (?????) ????? ?"????" ????
0 2n-1, ??? ????? ??? ???? ????? ?? ????? ?????
?? ?????.
11????? ?"? ?????? ?-2
2s Complement
- ????? ???? (?????) ???? ?? n ????? ???????? "????
????" ?? ??? ??? n1 - ?????.
- ???? ????? ? ???? ????? 0.
- ???? ????? ? ???? ????? 1.
- ????? ????? ????? ?"? ?????? ? 2n1. ??????
N2n1
X - Y X (N - Y) - N
????? N 23 8 n 1 3 n 2
0 000 1 001 2 010 3 011
4- 100 (4-8) 1- 111 (1-87) 2- 110
(2-86) 3- 101 (3-85)
1
?????? 2s Comp. ????? -2n ??? ?? ????? ?????.
???? ??????? ????
-2n, -2n1, , -1, 0, 1, 2, , 2n-1
12????? ? 2 - ???? ??????
- n ?????.
- ??????? ??? ????.
- X ????? ? (X, 0)
- X ????? ? (2n1-?X?)
- ?????? ?-2 ?? X ??? 2n1-X.
- ?????? ?-2 ?? ?X? ???2n1 (2n1 -?X?) ?X?
? ????? anan-1an-2a2a1a0 ????? ?? ?????
n1 ?????
- an 0 ? X ?????
- 1 an ? X ?????
??? ????? ?????!
???? -2n, -(2n-1), -(2n-2), , -2, -1, 0, 1, 2,
, 2n-2, 2n-1
13????? ? 2 - ???? ?????? (????)
14????? ?????? ? 2
????? (N2n1 ) N X
????? ?????? ?. ????? "?????" ????? ????? ???
????? ?? ????? ??????? ???? "1". ?. ???? ????
?????? ("1") ??? ????. ?. ???? ?????? ????? ??
???? ? 2. ? ???? "1" ? "0" ? "0" ?
"1".
Copy
Not
0 1 1 0 1 1 0 0 1 0 0 1 0 1 0 0
Leading Zeros Untouched
?????? ???? ? 0(1) ????? ???? ????.
15????? ????? ????? ? 2
??? X,Y ?????? ???????? ???? n ????? ?????
???? (n1) ??????? ?"? 2s Complement
XnXn-1X0 YnYn-1Y0
??? X,Y
???
XnXn-1X1 X0 YnYn-1Y1Y0
ZnZn-1Z0
??? XY
ZXY
??? ????
????? ???? ????
???? ????? overflow
?????? ???? ??????/?????? ?????? 2s Comp. .
16????? n3, ??? 3 (-5) ? 3 - 5 ? ????? ?
- n1 4 ??????.
3 00112 (-5) 24 5 0 1 0 1 2
1 0 1 1 2
1
1
?????
2s Comp.
-2 ?
????? n3, ??? 5 (-3) ? 5 - 3 ? ????? ?
- n1 4 ??????.
5 01012 (-3) 24 3 0 01 1 2
1 1 0 1 2
1
0
1
??? ???? "?????".
1
- ??????? ????? ?????. ??? ???? ?????? ?? ?????
(overflow) ?????? ???? ?????? ??? ???????
(???????) ??????? ????? (????) ??? ?????? ? n
?????.
17??????
- ?????? ?? ??? overflow.
- ????? ?? N2n1
????? ??? ???? ?????.
1 0 0 0 n1 n
n1 ?????
?. X,Y?0 ?????? ?????? ???? ???? ????? ???. ?.
X ( Y) ???? -Y ????? ?"? 2s Comp. ????
X?Y
X N Y (X Y) 2n1
???? ?????
2s Comp.
?0
?????
n1 ?????, ???? ?????
18??????
- ?????? ?? ??? overflow.
- ????? ?? N2n1
????? ??? ???? ?????.
1 0 0 0 n1 n
n1 ?????
?. X ( Y) , YgtX ,-Y ????? ?"? 2s
Comp. (????? X-Y) X N Y N (Y
X) ?. X, Y ??????? (N - ?X?) (N ?Y?)
N N (?X? ?Y?)
?????
?????? ?????? ??????? ???? ? 2s Comp.-
??? ???? ? ?????
????? ?????
19????? ??????? ????? ?????? ? 1
Ones complement 1s comp.
- X ? N X where N 2n1 - 1
???? ?????? ??? n ??????, ????? n1 ??? ????.
????? n2
0 000 0- 111 1 001 1- 110 (6 1-7) 2
010 2- 101 (5 2-7) 3 011 3- 100 (4
3-7)
"????????" ?????? ????? ? 1 ???? ?? ???? ????
0?1, 1?0. ? ????? ????? ? 2 ??? ????? ? 1 ????
1 ??????
???????
- ? "0" ????? ????.
- ????? ?????? ??? n ??????-(2n-1), -(2n-2),
,-0,0,1,2,,2n-1
-2n1
20????? ????? ????? ? 1
??? X, Y ?????? ???? "????" ?? n ??????,
??????? ?"? ????? ? 1 ????? n1 ??????. ??? X
Y ????? ?????? ? 1s comp.. ????? ?. ??? X
Y. ?. ?? ?? ??? ???? ??? ???? ?? ?????? (???
?????) ????? ?"? n3
?????? ?"? ????? ?????? ????? ? 2s comp.
X0 X1 X2 X3
Y0 Y1 Y2 Y3
Z0 Z1 Z2 Z3
c0
c1
c2
c3
C
??? ????
2 - 4
5 - 3
-0100
-0011
?????
1
-0010 -2
0 0 1 0
21?????/????? ????? ?????? ?1 ? ??????
- X Y ????? ???????, ??? ?????.
- X ( Y) ???? XgtY (?????? ??????)
- X Y ? X (2n1-1) Y 2n1 1 (X Y)
- 3. X ( Y) ???? XltY (?????? ??????)
- X - ?Y? ? X (2n1-1)- ?Y? (2n1-1)-(Y-X) ?
- (2n1-1-X) (2n1-1-Y) (2n1-1)
(2n1-1-(XY))
?????
??? ???? ?????
????? (??? ?????)
1s comp. ?? Y-X ??? X-Y
?????
4. (-X) (-Y)
1s comp. ?? -(XY)
1- ??? ????
221s Complement
2s Complement
??????
VS
- ???? ???? ????? ? 2 ?"? ????? ????? ? 1 ??????
?? 1 ??????. - (????? ????? ?????? ???? ???? ????? ? 2)
- ????? ?????? ???? ???? ???? ????? ? 2.
- (??? ???? ?? ?? ?????)
- ????? ???? ? 0 ?????? ? 2.
- ????? ???? ? 0 ?????? ? 1
111......1111 0......0
"0"
- ???? ??????
- -2n-1, -2n-11, , -1, 0, 1, , 2n-1-1
????? ? 2 - -2n-11, , -1, 0, 1, , 2n-1-1
????? ? 1
???? "?? ??????" ?? 0 ??????? ?????? ?? ????? ?
2, ??? ?? ????? ??????? ?????? ??? ?????? ????
????.
23??? ?????? ?? ????? (?? ?????)
- ??? Carry ???? ????? ?? "?????" ????? ?????
?????? ?????. - ????? Overflow ????? ?? ????? ?? ????? ??????
?????? ??? ?????? ?????? ???? ???.
????? ?????? ?? ?????? ??? 3 ????? (?????
??????) ?????? ????? ??????? ???????? ??? ????
????? ? ???? 4 ????? ?????.
7
0 1 1 1
3
-3
0 0 1 1
1 1 0 1
Virtual?????
??? ????
1 0 1 0 0
4
0 1 1 1
0 1 0 1
??? ??? ????
4
1 1 0 0
0 1 0 1
24????? ????? Overflow
- ?????? ??? n ?????, ??? ????? n.
an an-1 ? ? ? a1 a0
????? ??? ??????
n n-1
0 1 ? ? ?
0 1 ? ? ?
0
??? ???
1 0 ? ? ?
??? ??? ???? (n1) ?? ??? ? - n
????? ??? ???????
1 0 0 ? ? ?
1 1 0 ? ? ?
?? ??? ????
1
0 1 ? ? ? ?
?? ??? ???? (n1) ??? ??? ? n.
an an-1 a1 a0 bn bn-1 b1 b0 On
On-1
Cn
Cn-1
Ci ? ??? ?????? i"
Overflow Cn? Cn-1 1 ? Cn not of
Cn-1
25????? ????? ?????
b0
a0
b1
a1
b2
a2
b3
a3
C0
C1
C2
C3
Adder
Adder
Adder
Adder
"0"
??? ????
??? ???? ?????? ?????
S0
S1
S2
S3
Overflow Cn ? Cn-1 1
?????? (57) 1 C3 ? C2
- ?? ? - ??????? ?? ???? ????? ??? ????
????? ?????? ??? ???? ????? ??? ????. - ?? ? - ??????? ???? ????? ??? ???? ????
?????? ???? ????? ???? ??? ???? ????? ??????.
26???? ?? ??? ?????
b1
a1
Carrya1 b1?2
(a1 b1) mod 2
S
C
S 1 ??"? ????? ??? ? b1/a1 ???? 1. C 1 ??"?
?? a1 ??? b1 ???? 1. C a1 and b1 a1 ? b1
a1b1 S a1 Xor b1 a1 ? b1 a1 b1
a1b1 and, ?, ? ? function 0,1 ? 0,1) ?
0,1 and (x,y) 1 iff xy1 ??? ?????? ??
?????? ?????? ?????? ?? ?????? George Boole
(1854) ? Boolean Algebra
27????? ????? ??????
- ?????? ????? ?????? ?????? ???????.
- ????? ?? ??? ???? ???? ????? ??????? ???? ??
?????. - ????? ????? ?????? (?? ???? ??????)
- ECC Error Correcting Codes
- Linear Codes, Hamming, Reed Salomon
- Error Detecting Codes Checksum, Parity Checking
- Example ???? ??? ??? 4 ?????, ???? ????? ??????
- S (X1 X2 X3 X4) mod 2 X1 ? X2 ? X3 ?
X4 X1 X2 X3 X4 S 1 0 0 1 0 1 1 1 0
1
?? ????? ????? (X1 X2 X3 X4 S) mod 2 ? 0
28?????? ?????? ????? (??????)
(signed) char 8 bit short 16 bit int 32
bit long int 64 bit
- ?????? (Registers) ???? ???? ?? ??? ?????? ??????
???? (??? ???? ???? ???? ?????) ??????? ??????
?????? ?????????. - ???? ???? ALU ????? ??????? ?????? ??? ??? ?????
?????? ?????? (overflow)
R1
R2
R3
R4
29????? ????????
????? ?? ????? ?? ???????? ????? ?"? ?????
??????? ?? ?????. ????? BCD Binary Coded
Decimal
0 0001 7 0111 1 0001 8 1000 2 0010 9 100
1
????? ?????????? ASCII, EBCDIC (IBM)
A 1000001 0 0110000 B 1000010 1 0110001 C 1000011
9 0111001 Z 1011010 0100100 . 0101110 ( 0101
000 0111101