Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 53

Digital Systems

One characteristic of digital system is their ability to


represent and manipulate discrete elements of
information.
Early digital computers were used for numeric
computations. In this case, the discrete elements were
the digits. From this application, the term digital
computer emerged.
The signals in most present-day electronic digital
systems use just two discrete values and are therefore
said to be binary.
A binary digit, called a bit, has two values: 0 and 1.
Digital Systems (Cont.)
There are fundamental reasons that commercial
products are made with digital circuits. Like a digital
computer, most digital devices are programmable. By
changing the program in a programmable device, the
same underlying hardware can be used for many
different applications.
Binary Systems
Number Systems
The number system on r-based

an  r n  an1  r n1  ....  a2  r 2  a1  r1  a0


 a1  r 1  a2  r 2  ....  am  r m

Examples

(4021.2)5  4  53  0  52  2  51  1 50  2  51  (511 .4)10


(110101)  1 25  1 2 4  0  23  1 2 2  0  21  1 21
 32  16  4  1  (53)10
Binary Systems
642 is 600 + 40 + 2 in BASE 10
The base of a number determines the number of digits and
the value of digit positions
Positional Notation
What if 642 has the base of 13?
6 x 132 = 6 x 169 = 1014
+ 4 x 131 = 4 x 13 = 52
+ 2 x 13º = 2 x 1 =2
= 1068 in base 10
642 in base 13 is equivalent to 1068
in base 10
Binary
Decimal
 is base 10 and has 10 digits:
0,1,2,3,4,5,6,7,8,9
Binary
 is base 2 and has 2 digits:
0,1
How about base 1?
For a number to exist in a given number system, the number
system must include those digits.
 For example, the number 284 only exists in base 9 and higher.
Bases Higher than 10
How are digits in bases higher than 10 represented?
With distinct symbols for 10 and above.
Base 16 has 16 digits:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E, and F
Converting Octal to Decimal
What is the decimal equivalent of the octal number 642?

6 x 82 = 6 x 64 = 384
+ 4 x 81 = 4 x 8 = 32
+ 2 x 8º = 2 x 1 = 2
= 418 in base 10
Converting Hexadecimal to Decimal
What is the decimal equivalent of the hexadecimal
number DEF?

D x 162 = 13 x 256 = 3328


+ E x 161 = 14 x 16 = 224
+ F x 16º = 15 x 1 = 15
= 3567 in base 10
Remember, the digits in base 16 are
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
Converting Binary to Decimal
What is the decimal equivalent of the binary number
1101110?
1 x 26 = 1 x 64 = 64
+ 1 x 25 = 1 x 32 = 32
+ 0 x 24 = 0 x 16 =0
+ 1 x 23 = 1x8 =8
+ 1 x 22 = 1x4 =4
+ 1 x 21 = 1x2 =2
+ 0 x 2º = 0x1 =0
= 110 in base 10
Representation
345.67810 = 3*102 + 4*101 + 5*100 +
6*10-1 + 7*10-2 + 8*10-3
1010.112 = 1*23 + 0*22 + 1*21 + 0*20 +
1*2-1 + 1*2-2
123.458 = 1*82 + 2*81+3*80 +
4*8-1 + 5*8-2
89A.BC16 = 8*162 + 9*161 + 10*160 +
11*16-1 + 12*16-2
Arithmetic in Binary
Remember that there are only 2 digits in binary,
0 and 1
Position is key, carry values are used:

111111 Carry Values


1010111
+1 0 0 1 0 1 1
10100010
Subtracting Binary Numbers
Remember borrowing? Apply that concept here:
12
202
1010111
- 111011
0011100
Converting Binary to Octal
 Groups of Three (from right)
 Convert each group

10101011 → 10 101 011


2 5 3
10101011 is 253 in base 8
Converting Binary to Hexadecimal
Groups of Four (from right)
Convert each group

10101011 → 1010 1011


A B
10101011 is AB in base 16
Converting Decimal to Other Bases
Algorithm for converting base 10 to other bases

While the quotient is not zero


Divide the decimal number by the new base
Make the remainder the next digit to the left in the
answer
Replace the original dividend with the quotient
Converting Decimal to Hexadecimal

Try a Conversion

The base 10 number 3567 is what number in base 16?


Converting Decimal to Hexadecimal
222 13 0
16 3567 16 222 16 13
32 16 0
36 62 13
32 48
47 14
32
15

D E F
Converting
Decimal → Binary
59.7510 = 5910 + 0.7510
 Wholepart
2 59 1 (remainder of 59 divide 2)
2 29 1 (remainder of 29 divide 2)
2 14 0 (remainder of 14 divide 2)
2 7 1 (remainder of 7 divide 2)
2 3 1 (remainder of 3 divide 2)
1 → 5910 = 1110112
Converting
 Fractional part
multiply 2, take the first number before point
until cycle or zero
0.75 * 2 = 1.5 → 1
0.50 * 2 = 1.0 → 1
0.7510 = 0.1102
 Merge whole part and fractional part →
59.7510 = 111011.112
Converting
Decimal → Octal
 Same as Decimal → Binary
 whole part: divide 2 → divide 8

 Fractional part: multiply 2 → multiply 8

 5176.65 = 12070. 51463


10 8

Decimal → Hexadecimal
 Same as Decimal → Binary
 whole part: divide 2 → divide 16

 Fractional part: multiply 2 → multiply 16

 4877.1562510 = 130D.2816
Converting
Octal / Hexadecimal → Binary
5 7 6 2. 1 38 = 101 111 110 010. 001 0112

E 8 C 4. B16 = 1110 1000 1100 0100. 10112


Converting
Binary → Octal / Hexadecimal
group 3 or 4 numbers
011 010 111.101 1002 = 3 2 7. 5 48
0010 1101 0111 1010. 1111 00102 = 2 D 7 A. F 216
Binary and Computers
Binary computers have storage units
called binary digits or bits

Low Voltage = 0
High Voltage = 1 all bits have 0 or 1
Binary and Computers
Byte = 8 bits
The number of bits in a word determines the word
length of the computer, but it is usually a multiple of
8
32-bit machines
64-bit machines etc
Binary Systems
Complements
Diminished radix complement: (r-1)’s complement
 A number N in base r having n digitals
 (r-1)’s complement =
(r n  1)  N
 Ex.
 9’s complement of 546700 is 999999-546700 = 453299

 1’s complement of 0101101 is 1010010


Binary Systems
Radix complement: r’s complement
 A number N in base r having n digitals

 r’s complement =  0 , if N 0 
 n 
r  N , if N 0 
 Ex.
 10’s complement of 012398 is 987602

 2’s complement of 0110111 is 1001001


Binary Systems
Subtraction with Complements
Subtraction of two n-digit unsigned numbers M-N in
base r
 Add the minuend M to the r’s complement of the subtrahend
N: M + ( rn - N)
 If M > N, the sum will produce an end carry, r n
 Discard it, leave M- N

 If M < N, the sum does not produce an end carry, is equal to


rn – (N - M), which is the r’s complement of (N-M). To obtain
the answer in a familiar form, take the r’s complement of the
sum and place a negative sign in front.
Binary Systems
Ex.
Using 10’s complement, subtract 72532-3250
M = 72532
10’s complement of N = + 96750
Sum = 169282
Discard end carry 105 = -100000
Ans= 69282
Binary Systems
Signed Binary Numbers
Signed-magnitude representation 10001001
Signed-1’s complement representation 11110110
Signed-2’s complement representation 11110111
Binary Systems
Binary Systems
Arithmetic Addition

Arithmetic Subtraction
(±A) – (+B) = (±A) + (-B)
(±A) – (-B) = (±A) + (+B)
Binary Systems
Binary Codes
BCD code
2421 code
Excess-3 code
8 4-2-1 code
Gray code
ASCII code
Binary Systems
BCD code (Binary Coded Decimal )
Represent the decimal digits by means of a code that
contains 1’s and 0’s.
4-bit code ← 24 > 10 (0, 1, 2, 3, 4, …, 9)
Binary Systems
(185)10 = (0001 1000 0101)BCD = (10111001)2

Addition
 When the binary sum of two BCD numbers is greater than or
equal to 1010, it need to add 6 = (0110)2 to the binary sum to
correct the sum and get a carry
Binary Systems
4 0100 4 0100 8 1000
+5 +0101 +8 +1000 +9 +1001
9 1001 12 1100 17 10001
+0110 +0110
10010 10111
Binary Systems
Subtraction
 Using 10’s complement of a BCD
 (+375) + (-240) = +135

 10’s complement of 0240 = 9760, then


Binary Systems
Binary Systems
Category
Weighted codes
 BCD / 2421 / 8,4,-2,-1
 8,4,-2,-1 code represents both positive and negative weights

Self-complementing codes
 9’s complement of a decimal number is 0 ←→ 1
 2421 / Excess-3
Binary Systems
Gray code
Convenient for continuous
information
Only one bit changes in value
during any transition between
two neighbor numbers
Binary Systems
Alphanumeric characters
ASCII (American Standard Code for Information
Interchange)
7 bits for 128 characters
 94 graphic characters that can be printed
 34 non printing characters for control functions
 Format effectors

 Backspace, carriage return

 Information separators

 Record separator

 Communication-control characters

 Start of text, end of text, acknowledge


Binary Systems
Binary Systems
Binary Systems
ASCII is a 7 bits code, but most computers manipulate an 8
bits as a single unit
Extra bit sometimes used for other purposes
 Greek alphabet or italic type font
Binary Systems
Error-Detecting Code
Parity bit is an extra bit to make the total number of 1’s
either even or odd.
ASCII A=1000001
Even parity 01000001
 Odd parity 11000001

Detect 1, 3, or ant odd combination of errors


Binary Systems
Register
A group of binary cells
ex. 1100001111001001
the content of the register represents
 Integer 50121
 Two characters, C and I
 Excess-3 code, 9096
 Not BCD, because 1100 does not exist in BCD codes

Register transfer
 A transfer of binary information from one set of register into
another set of registers
Binary Systems
Binary Systems
Adding two 10-bit binary number
Binary Systems
Binary Logic
Two discrete values, 0/1, true/false
Definition
 Binary logic consists of binary variables and logical operations
 AND / OR / NOT

 True Tables

Logic gate
 Voltage-operated circuits respond to two separate voltage levels
(0/1)
Binary Systems
Binary Systems
State transition

0 1 0
Binary Systems

You might also like