Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Input
Signal
Converter
A/D
binary
Digital
System
binary
Converter
D/A
Examples:
(Analog)
Signal
Output
Digital Systems
Digital System
Output
Signals
(binary)
3
Input
Signals
(binary)
Input
Devices
104a4+103a3+102a2+101a1+100a0+10-1a-1+10-2a-2+10-3a-3
Output
Device
Input-Output Units
Storage
Memory
Unit
Central Processor
Unit (CPU)
Secondary
CPU:
Arithmetic operations
Logical operations
Example 1: (11010.11)2 = 1 x 24 + 1 x 23 + 0 x 22 +
1 x 21 + 0 x 20 + 1 x 2-1 + 1 x 2-2 =(26.75)10
anrn+an-1rn-1++a2r2+a1r1+a0+a-1r-1+a-2r-2++a-mr-m
Number Systems
10
101101
- 100111
------------000110
12
Integer Remainder
234
29
2
3
5
0
3
(352)8 = answer
101
x 101
---------101
000
101
-------------11001
101101
+100111
---------------1010100
Subtraction: 101101-100111
Arithmetic (2)
Addition: 101101+100111
Arithmetic (1)
13
11
13=D
4
1
Remainder
(14D)16 = answer
=
=
=
=
3
2
2
7
0.296
0.368
0.944
0.552
Fraction
0.412 x 8
0.296 x 8
0.368 x 8
0.944 x 8
Integer
14
a-1=3
a-2=2
a-3=2
a-4=7
16
Coefficient
Integer
333
20
1
0
=
=
=
=
1
0
1
1
0.3750
0.7500
0.5000
0.0000
Fraction
a-1=1
a-2=0
a-3=1
a-4=1
15
Coefficient
0
1
2
3
4
5
6
7
8
9
A
B
C
D
E
F
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
17
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
Hex.
Binary
-------------------------------
Octal
Binary
------------------------------0
=
000
1
=
001
2
=
010
3
=
011
4
=
100
5
=
101
6
=
110
7
=
111
0.6875 x 2
0.3750 x 2
0.7500 x 2
0.5000 x 2
Integer
18
Complements
Binary to octal
(10110001101011.111100000110)2
(10 110 001 101 011 . 111 100 000 110)2
=(2 6 1 5 3 . 7 4 0
6)8
-------------------------------------------------------------Binary to hexadecimal
(10110001101011.111100000110)2
(10 1100 0110 1011 . 1111 0000 0110)2
= (2 C
6
B . F
0
6
Examples (1)
19
Examples:
The 9s complement of 546700 is 999999 546700 =
453299.
The 9s complement of 012398 is 999999 012398 =
987601.
21
Octal to binary
(354.7)8 = ( 011 101 100 . 111 )2
Hexadecimal to binary
(A3E)16= ( 1010 0011 1110 )2
Examples (2)
24
22
for N
23
25
Examples:
The 10s complement of 2389 is 7610+1=7611.
The 2s complement of (101100)2 is
010011+1=(010100)2
Sum =
There is no end carry.
The answer is (10s complement
of 80733)
Example 2
28
= -19267
07280
+73453
------------80733
26
27
26547
+92720
------------119267
-100000
------------19267
29
111100
2s complement of 100111 =
+011001
------------1010101
Sum =
6
Discard end carry 2
-1000000
--------------Answer =
010101
Example 3
Answer =
Sum =
Discard end carry 105
Example 1
+6
-13
------7
00000110
11110011
-----------11111001
-6
-13
------19
32
11111010
11110011
------------11101101
30
= -010101
100111
+000100
------------101011
Arithmetic Addition
Sum =
There is no end carry.
The answer is (2s complement
of 101011)
2s complement of 111100 =
Example 4
Arithmetic Subtraction
33
31
4
+5
----9
0100
+0101
-------1001
8
1000
+3 +0011
----- --------11
1011
+0110
--------10001
Examples:
(10)10= (0001 0000)BCD = (1010)2
(185)10 = (0001 1000 0101)BCD = (10111001)2
BCD Code
36
34
Binary Codes
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
0
1
2
3
4
5
6
7
8
9
184
+576
------760
-----0111
0001
+0101
------0111
1000 0100
0111 0110
-------- -------10000 1010
+0110 +0110
-------- ------0110 0000
BCD
Digit
Decimal Symbol
37
35
40
38
Other Codes:
Gray Code: only one bit in the code group changes
when going from one number to the next.
Sum
Processor Unit
R3
0100100010
0 0 1 1 10 0 0 0 0 R2
0 0 0 1 0 0 0 0 1 0 R1
0001000010
0011100001
0000000000
11000001
01010100
Operand 2
Operand 1
Memory Unit
01000001
11010100
Binary Addition
ASCII A = 1000001
ASCII T = 1010100
41
39
Error-Detecting Code
44
Binary Logic
x
y
y
0
1
0
1
x
0
0
1
1
x.y
AND Gate
z= x.y
x
y
0
1
x+y
OR Gate
x
z= x+y
x
1
0
x
0
1
NOT Gate
43
Logic Gates
z=x