Lecture1 DLC
Lecture1 DLC
Introduction/
Number Systems and Conversion
Introduction
Instructor:
Andrew Beng Jin TEOH
Email: [email protected]
Office: C225
Ext. 5772
2
Introduction
Textbook:
Charles H. Roth, Jr.,
Fundamentals of
Logic Design.
International Student
Edition (7th Edition).
Lecture Slides:
http://yscec.yonsei.ac.kr/
3
Grading Policy
Online Quizzes: 20%
Attendance: 10%
4
Digital Systems and Logic Circuits (1/4)
Digital system
The physical quantities or signals can assume only
discrete values
Greater accuracy
Analog system
The physical quantities or signals may vary
continuously over a specified range
5
Digital Systems and Logic Circuits (2/4)
Many of subsystems of a digital system take the form of
a switching network
What’s switching network?
6
Digital Systems and Logic Circuits (3/4)
Most general model of a digital system
Often referred to as General Sequential Logic
Consists of:
• Combinational logic
o Performs logical operations
• Memory elements
o Stores data
7
Digital Systems and Logic Circuits (4/4)
Logic Circuits
Combinational Circuits
• Output: function of input’s present values
• No memory
Sequential Circuits
• Output: function of input’s present values and
previous values
• Combinational Circuits + Memory
8
Digital systems are everywhere
Digital watches
CD players
Electronic games
etc
9
Digital System Hierarchy
Computer
Organization
IC Design
VLSI CAD
Not our concern, related to microelectronic
and IC fabrication etc
10
Course Outline
Goal
Being familiar with Boolean algebra and the basic
knowledge of logic design.
11
Course Outline
Traffic light
Digital controller,
System vending machine
CD player etc
Combinational/S
equential Circuit
Design
Simplification
(Karnaugh Maps, QM etc)
Boolean Algebra
Number Systems
12
Content
Number System and Conversion
Number Systems and Conversion
Binary Arithmetic
Representation of Negative Numbers
• Addition of 2’s Complement Numbers
• Addition of 1’s Complement Numbers
Binary Codes
13
Number Systems and Conversion (1/10)
Positional notation
Base 10:
Decimal
Integer fractional
Base 2:
14
Number Systems and Conversion (2/10)
Base R:
Any positive integer R (R>1) can be chosen as the radix
or base of a number system.
Base R number
Base 10 number
where 0 a i R 1 .
15
Number Systems and Conversion (3/10)
Example:
Base 8:
Octal
01234567
Base16
Hexadecimal
0123456789ABCDEF
16
Number Systems and Conversion (4/10)
Convert a decimal integer to base R
17
Number Systems and Conversion (5/10)
Example : Convert 5310 to binary.
18
Number Systems and Conversion (6/10)
Convert a decimal fraction to base R
19
Number Systems and Conversion (7/10)
Example: Convert 0.62510 to binary.
20
Number Systems and Conversion (8/10)
Example: Convert 0.710 to binary.
21
Number Systems and Conversion (9/10)
Example: Convert 231.34 to base 7.
Base 4 → Base 10
Base 10 → Base 7
22
Number Systems and Conversion (10/10)
Direct Conversion from binary to hexadecimal ( and
conversely)
One hexadecimal digit corresponds to four binary
digits (bits)
23
Binary Arithmetic (1/4)
Addition
24
Binary Arithmetic (2/4)
Subtraction
Examples:
25
Binary Arithmetic (3/4)
Multiplication
Example:
26
Binary Arithmetic (4/4)
Division
Example: 145/11=13 --- 2
27
Representation of Negative Numbers (1/4)
28
Representation of Negative Numbers (2/4)
29
Representation of Negative Numbers (3/4)
Example: 2’s complement for -2110, N = 2110 = 0101012,
Since n = 6 (the length of 010101)
2n 1000000
- N 010101
N * 101011
30
Representation of Negative Numbers (4/4)
Sign and Magnitude Binary Numbers
31
Addition of 2’s Complement Numbers (1/4)
Addition of n-bit signed binary numbers
Any carry from the sign position is ignored.
n=4
32
Addition of 2’s Complement Numbers (2/4)
A B A* B ( 2 n A ) B
2 n ( B A ) 2 n ( B A, carry)
Throwing away the last carry is equivalent to subtractin g 2 n ,
so the result is ( B A ).
33
Addition of 2’s Complement Numbers (3/4)
A B A* B* (2n A) (2n B)
2n 2n ( A B) 2n ( A B 2n1 , carry)
Discarding the last carry yields 2n ( A B) ( A B)* ,
which is the correct representation of ( A B).
34
Addition of 2’s Complement Numbers (4/4)
Example: Add -8 and +19 in 2’s complement for a word length
of n=8.
35
Addition of 1’s Complement Numbers (1/4)
Addition of n-bit signed binary numbers
Add the last carry ( end-around carry) to the n-bit sum in the
position furthest to the right.
n=4
36
Addition of 1’s Complement Numbers (2/4)
A B A B (2 n 1 A) B
2 n ( B A) 1 2 n ( B A, carry)
The end - around carry is equivalent to subtracting 2 n and adding 1,
so the result is ( B A).
37
Addition of 1’s Complement Numbers (3/4)
A B A B (2 n 1 A) (2 n 1 B )
2 n [ 2 n 1 ( A B )] 1 2 n ( A B 2 n 1 , carry)
Discarding the last carry yields 2 n 1 ( A B ) ( A B ),
which is the correct representation of ( A B ).
38
Addition of 1’s Complement Numbers (4/4)
Example: Add -11 and -20 in 1’s complement for a word
length of n=8.
39
Binary Codes (1/3)
Weighted code w3 w2 w1 w0 weighted code a3a2a1a0
a3a2 a1a0 w3a3 w2a2 w1a1 w0a0
Binary-Coded-Decimal, BCD; 8-4-2-1BCD code
• 0101BCD=0x8+1x4+0x2+1x1=5
6-3-1-1 code
• 01016-3-1-1=0x6+1x3+0x1+1x1=4
Excess-3 code
8-4-2-1 code + 0011
The code of i is the 1’s complement of code 9-i
2-out-of-5 code
Exactly 2 out of 5 bits are 1
Error-checking properties
Gray code
The codes for successive decimal digits differ in exactly one bit.
ASCII code
American Standard Code for Information Interchange
40
Binary Codes (2/3)
41
Binary Codes (3/3)
1010011 1110100 1100001 1110010 1110100
S t a r t
42
End
“This lecture material has been produced and published expressly for lecture purposes in
support of a Yonsei University course. This material cannot be used for any other purposes
and cannot be shared with others. Individuals who violate these terms and restriction are
legally responsible for any violation of intellectual property laws.”