0% found this document useful (0 votes)
10 views43 pages

Lecture1 DLC

The document discusses number systems and conversion between different bases. It covers converting between decimal, binary, octal and hexadecimal. It also discusses binary arithmetic operations and different methods for representing negative numbers in binary including 1's complement and 2's complement. Addition of signed binary numbers using both 1's complement and 2's complement representations is demonstrated through examples.

Uploaded by

Yushi Shi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views43 pages

Lecture1 DLC

The document discusses number systems and conversion between different bases. It covers converting between decimal, binary, octal and hexadecimal. It also discusses binary arithmetic operations and different methods for representing negative numbers in binary including 1's complement and 2's complement. Addition of signed binary numbers using both 1's complement and 2's complement representations is demonstrated through examples.

Uploaded by

Yushi Shi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

Lecture 1

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%

 Design Project (work in group): 20%

 Midterm Exam: 25%

 Final Exam: 25%

 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

 Combinational logic = Combinational Circuit

 Combinational logic + Memory Elements = Sequential


Circuit

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

 These two circuits will be the focus of this course


 Beginning with combinational logic

8
Digital systems are everywhere
 Digital watches

 CD players

 Electronic games

 Telephone and television networks

 Missile guidance systems

 Airplanes and space shuttles

 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.

 What you can learn in this course?


 Logic and its simplification.
 Basic gate-level logical circuit design.
 Combinational and sequential logic circuits.
 Simple logic circuit design for applications

 What can you NOT Learn in this course?


 HDL, Verilog, VHDL.

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 .

Base R → Base 10 (Decimal number) Conversion

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

N  ( an an 1    a2a1a0 ) R  an R n  an 1R n 1      a2 R 2  a1R1  a0


N
 an R n 1  an 1R n 2    a2 R1  a1  Q1 , remaider a0
R
Q1
 an R n 2  an 1R n 3    a3 R1  a2  Q2 , remaider a1
R
Q2
 an R n 3  an 1R n 4    a4 R1  a3  Q3 , remaider a2
R

 This process is continued until we finally obtain Qn = 0.

Base 10 → Base R Conversion

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

F  (.a1a2a3    am ) R  a1R 1  a2 R 2  a3 R 3      am R  m


FR  a1  a2 R 1  a3 R 2      am R m 1  a1  F1
F1R  a2  a3 R 1  a4 R 2      am R m  2  a2  F2
F2 R  a3  a4 R 1  a5 R 2      am R m 3  a3  F3

 This process is continued until we have obtained a


sufficient number of digits.

Base 10 → Base R Conversion

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)

(306.D)16  (0011 0000 0110  1101) 2


3 0 6 D

23
Binary Arithmetic (1/4)
 Addition

 Example: Add 1310 and 1110 in binary.

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

 Example: 1’s complement for -2110


2n  1 111111
- N  010101
N  101010

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

How do we solve this problem?

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  2n1 , 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.”

You might also like