Professional Documents
Culture Documents
GC214 1
GC214 1
Chapter 1 – Digital
Computers and Information
Chapter 1 2
Digital System
Discrete Discrete
Inputs Information
Processing Discrete
System Outputs
System State
Chapter 1 3
Types of Digital Systems
§ No state present
• Combinational Logic System
• Output = Function(Input)
§ State present
• State updated at discrete times
=> Synchronous Sequential System
• State updated at any time
=>Asynchronous Sequential System
• State = Function (State, Input)
• Output = Function (State)
or Function (State, Input)
Chapter 1 4
Signal
Chapter 1 5
Signal Examples Over Time
Time
Continuous in
Analog value & time
Digital Discrete in
value &
Asynchronous continuous in
time
Discrete in
Synchronous
value & time
Chapter 1 6
Binary Values: Other Physical Quantities
Chapter 1 7
Number Systems – Representation
(Number)r = (åi=n-1
Ai r )+( å
i
j=-1
Aj r)
j
i=0 j=-m
(Integer Portion) + (Fraction Portion)
Chapter 1 8
Number Systems – Examples
Chapter 1 9
Positive Powers of 2
Chapter 1 11
Converting Decimal to Binary
§ Method 1
• Subtract the largest power of 2 (see slide 14) that gives a positive
remainder and record the power.
• Repeat, subtracting from the prior remainder and recording the
power, until the remainder is zero.
• Place 1’s in the positions in the binary result corresponding to the
powers recorded; in all other positions place 0’s.
§ Example: Convert 62510 to N2
625 – 512 = 113 => 29
113 – 64 = 49 => 26
49 – 32 = 17 => 25
17 – 16 = 1 => 24
1– 1= 0 => 20
1001110001 Chapter 1 12
Commonly Occurring Bases
Chapter 1 13
Numbers in Different Bases
§ Method 2
§ To convert from one base to another:
1) Convert the Integer Part
2) Convert the Fraction Part
3) Join the two results with a radix point
Chapter 1 15
Conversion Details
Chapter 1 16
Example: Convert 46.687510 To Base 2
§ Convert 46 to Base 2
§ Convert 46 to Base 2
6/2 = 23 rem = 0
23/2 = 11 rem = 1
11/2 = 5 remainder = 1
5/2 = 2 remainder = 1
2/2 = 1 remainder = 0
1/2 = 0 remainder = 1
Reading off in the reverse direction: 101110
Chapter 1 18
Example: Convert 46.687510 To Base 2
Chapter 1 19
Additional Issue - Fractional Part
Chapter 1 21
Why Do Repeated Division and
Multiplication Work?
§ Divide the integer portion of the power series
on slide 11 by radix r. The remainder of this
division is A0, represented by the term A0/r.
§ Discard the remainder and repeat, obtaining
remainders A1, …
§ Multiply the fractional portion of the power
series on slide 11 by radix r. The integer part of
the product is A-1.
§ Discard the integer part and repeat, obtaining
integer parts A-2, …
§ This demonstrates the algorithm for any radix
r >1.
Chapter 1 22
Octal (Hexadecimal) to Binary and
Back
Chapter 1 23
Octal to Hexadecimal via Binary
Chapter 1 24
Binary Numbers and Binary Coding
§ Flexibility of representation
• Within constraints below, can assign any binary
combination (called a code word) to any data as long
as data is uniquely encoded.
§ Information Types
• Numeric
§ Must represent range of data needed
§ Very desirable to represent data such that simple,
straightforward computation for common arithmetic
operations permitted
§ Tight relation to binary numbers
• Non-numeric
§ Greater flexibility since arithmetic operations not applied.
§ Not tied to binary numbers
Chapter 1 26
Non-numeric Binary Codes
Chapter 1 27
Number of Bits Required
§ There are over 8,000 ways that you can chose 10 elements
from the 16 binary numbers of 4 bits. A few are useful:
Chapter 1 30
Binary Coded Decimal (BCD)
Chapter 1 31
Excess 3 Code and 8, 4, –2, –1 Code
Chapter 1 33
Warning: Conversion or Coding?
Chapter 1 37
Binary Arithmetic
Chapter 1 38
Single Bit Binary Addition with Carry
Carry in (Z) of 1: Z 1 1 1 1
X 0 0 1 1
+Y +0 +1 +0 +1
CS 01 10 10 11
Chapter 1 39
Multiple Bit Binary Addition
Chapter 1 40
Single Bit Binary Subtraction with Borrow
§ Given two binary digits (X,Y), a borrow in (Z) we
get the following difference (S) and borrow (B):
§ Borrow in (Z) of 0: Z 0 0 0 0
X 0 0 1 1
-Y -0 -1 -0 -1
BS 00 11 01 00
§ Borrow in (Z) of 1: Z 1 1 1 1
X 0 0 1 1
-Y -0 -1 -0 -1
BS 11 10 00 11
Chapter 1 41
Multiple Bit Binary Subtraction
Chapter 1 42
Binary Multiplication
Chapter 1 45
Error-Detection Codes
Chapter 1 46
4-Bit Parity Code Example
§ One’s Complement:
• Of a binary number is the value obtained by
inverting all the bits in the binary representation
of the number (swapping 0s and 1s)
• Ex: 127 = 0111 1111
§ One’s complement : 1000 000
• Ex: 255 = 1111 1111
§ One’s complement : 0000 0000
Chapter 1 48
Complements
§ Two’s Complement:
• Two's complement is the most common method
of representing signed integers on computers.
• It is calculated by inverting the bits (1’s
Complement) then adding one
• Ex: 127 = 0111 1111
§ One’s complement: 1000 0000
§ Two’s complement: 1000 0001 = -127
Chapter 1 49
ASCII Character Codes
Chapter 1 51
UNICODE
Chapter 1 52
Terms of Use
Chapter 1 53