Pres1 Introduction and Numbers
Pres1 Introduction and Numbers
Presentation 1:
Digital Computers and
Number Systems
'generality'
follow a sequence of instruction, called a program,
that operates on given data
perform a variety of information-processing tasks
Digital computer
the best-known example of a digital system
manipulate discrete elements of information
(ex) 10 decimal digits, 26 letters of the alphabets, ....
1.1 Digital Computers
Signals
electrical signals such as voltages and currents
two discrete values
High (output) 4.5~5.5 (input) 3.0~5.5
Low (output) -0.5~1.0 (input) -0.5~2.0
High & Low (H & L), True & False, 1 & 0
More
FPU (floating-point unit)
MMU (memory management unit)
(Memory: MMU + internal cache + external cache + RAM)
Combinational Logic
logic circuits for digital systems: combinational vs sequential
Combinational Circuit
outputs are determined by the present applied inputs
performs an operation, which can be specified logically
by a set of Boolean expressions
Combinational
Circuit
1.2 Number Systems
decimal number (base 10 or radix 10)
724.5 = 7 x 102 + 2 x 101 + 4 x 100 + 5 x 10-1
In general,
AnAn-1....A1A0.A-1A-2....A-m+1A-m
base r or radix r
expressed with a power series in r
An rn + An-1 rn-1 + .... + A1 r1 + A0 r0 + A-1 r-1 + A-2 r-2 + .…
+ A-m+1 r-m+1 + A-m r-m
expresses in positional notation
AnAn-1....A1A0.A-1A-2....A-m+1A-m
(625)10 = 29 + 26 + 25 + 24 + 20 = (1001110001) 2
1.2 Number Systems
Octal and Hexadecimal Number
octal number - base 8 (0, 1, ..., 6, 7)
(127.4)8 = 1x82 + 2x81 + 7x80 + 4x8-1 = (87.5 )10
hexadecimal number - base 16 (0,1,....,9,A,B,C,D,E,F)
(B65F)16 = 11x163 + 6x162 + 5x161 + 15x160 =
(46687)10
1 octal digit = 3 binary digits
1 hexa digit = 4 binary digits
conversion
(0010 1100 0110 1011. 1111 0000 0110)2 =
(2C6B.F06)16
(3A6.C)16 = 0011 1010 0110. 1100 =
(1110100110.11)2
1.2 Number Systems
(Ex1.5) (0.6875)10 = ( ? )2
0.6875 x 2 = 1.375 .... 1
0.375 x 2 = 0.75 .... 0
0.75 x 2 = 1.5 .... 1
0.5 x 2 = 1.0 .... 1
(0.6875)10 = (0.1011)2
1.4 Decimal Codes
decimal number system (people are accustomed to)
(vs) binary number system (natural for computer)
2 ways
convert decimal numbers to binary
perform all arithmetic calculation in binary
(185)10
= (0001 1000 0101)BCD = (101110001)2
BCD numbers are decimal numbers, not binary
numbers
1.4 Decimal Codes
BCD Addition
Parity Bit
ASCII is a 7-bit code + 1 bit => 8-bit (1 byte)
\---- used for specific purpose
1.5 Alphanumeric Codes
leaving all least significant 0's and the first 1 unchanged then
replacing 1's with 0's, 0's with 1's
2's comp of 1101100 ==> 0010100
2's complement of N is 2n – N
& the complement of the complement is 2n - (2n-N) = N
Complements
Subtraction with Complements
(M - N)
1) add 2's comp of the
subtrahend N to the minuend
M
M + (2n-N) = M - N + 2n
2) if M > N, the end cary is
discarded
3) if M < N, the result is 2n - (N
- M)
take the 2's complement of
the sum & place a minus sign
avoid overflow problem to
accomodate the sum