SlideShare a Scribd company logo
Department of Communication Engineering, NCTU 1
Unit 1 Introduction
1. Digital Systems
2. Number System and Conversion
3. Binary Arithmetic
Department of Communication Engineering, NCTU 2
1.1 Digital Systems
Department of Electrical Engineering, NCTU 3
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 Digital Systems:
 A system that can perform data computation, storage and data
input and output in digital formats
 Why digital systems instead of analog systems?
 Easy and reliable control of data precision (number of bits)
 Easy and reliable circuit implementations (on/off switch)
 Applications of Digital Systems:
 Computation, data processing, signal acquisition and processing,
automatic control, communications and measurements, etc
Input/Output
Interface
Arithmetic/Logic Unit
Data Storage
Control Unit
Department of Electrical Engineering, NCTU 4
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 Design of digital systems includes 3 phases:
 System design: design functions to meet specific applications
 Logic design : implement functions in logic gates
 Circuit design : design and implement logic gates
 System design involves functional definitions and system
partitions. The aspect of system design varies a lot
 Logic design means coming up with methods to
implement the defined functions, using basic logic units
 Circuit design here refers to the implementations of basic
logic units such as AND, OR, Flip-Flops, etc. with
resistors, diodes and transistors
 We will not cover circuit design in this course
Department of Electrical Engineering, NCTU 5
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 A simple digital system : Y = max { C, A+B}
 If C > A+B
Y=C
else
Y=A+B
 A simple logic implementation of the above system
Yes, C1=1
Start
A+B > C
Save Y
No, C1=0
C2
A B C
Adder
Comp
Mux
Y
C1
C2
Department of Electrical Engineering, NCTU 6
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 Logic circuits can be categorized into two classes:
 Combinational logic
 Sequential Logic
 Combinational logic’s outputs depend only on the
present inputs:
 E.g. Adder, multiplier, comparator, multiplexer
 Sequential logic’s output depend on both the present
and the past outputs. In general, a sequential circuit is
composed of a combinational circuit with added
memory elements.
 E.g. C = A+B
E = C+D
F = CD
Department of Communication Engineering, NCTU 7
1.2 Number Systems and
Conversion
Department of Electrical Engineering, NCTU 8
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 Base R representation of a rational number
 Any positive integer R > 1 can be chosen as the base of a
number
 E.g. : converting an octal number to decimal
3 82 + 2 81 + 1 80 + 1 8-1
= 192 + 16 + 1 + 0.125
= 208.125
4 3 2 1 0 1 2 3
4 3 2 1 0
4 3 2 1 0
1 2 3
1 2 3
( . )
0 1i
N a a a a a a a a
a R a R a R a R a R
a R a R a R
a R
  
  
  

          
      
  
 


其中where
Department of Electrical Engineering, NCTU 9
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 For bases greater than 10, more than 10 symbols are
needed to represent the digits
 Letters are usually used to represent digits greater than 9
 E.g., for a hexadecimal number, we have digits
0,1,2,3,…9,A,B,C,D,E,F
 E.g. : converting a hexadecimal to decimal
A 162 + 2 161 + B 160 + F 16-1
= 10 256 + 2 16 + 11 + 15/16
= 2603.9375
Department of Electrical Engineering, NCTU 10
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 Conversion of a decimal number to base R
10 2
For integer,
53 110101
53 2 26 1
26 2 13 0
13 2 6 1
6 2 3 0
3 2 1 1

 
 
 
 
 





使用除法
10 2
For fraction,
.625 .101
.625 2 1.25 1
.25 2 0.5 0
.5 2 1.0 1

 
 
 
使用乘法use division use multiplication
Department of Electrical Engineering, NCTU 11
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 Conversion between two bases R1 & R2 other than
decimal
 Convert from base R1 to decimal first, then convert the
decimal number to base R2
4 10 7231.3 45.75 63.5151
45 7 6 3
.75 7 5.25 5
.25 7 1.75 1
.75 7 5.25 5
 
 
 
 
 


Department of Communication Engineering, NCTU 12
1.3 Binary Arithmetic
Department of Electrical Engineering, NCTU 13
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 Arithmetic operations in digital systems are usually done
in binary because design of logic circuits to perform
binary arithmetic is much simpler than decimal arithmetic
 We only need switches: On  1, OFF  0
 Binary addition
0 0 0
0 1 1
1 0 1
1 1 0 carry 1 to the next column
 
 
 
 
10
10
10
Ex.
1111 carries
13 = 1101
11 = 1011
24 11000

Department of Electrical Engineering, NCTU 14
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 Binary subtraction
0 0 0
0 1 1 borrow 1 from the next column
1 0 1
1 1 0
 
 
 
 
Ex.
1 borrow
11101
10011
1010


Department of Electrical Engineering, NCTU 15
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 Binary multiplication
0 0 0
0 1 0
1 0 0
1 1 1
 
 
 
 
Ex.
1101
1011
1101
1101
0000
1101
10001111

Department of Electrical Engineering, NCTU 16
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 Binary division is similar to decimal division
Ex.
1101
1011 10010001
1011
1110
1011
1101
1011
10
Department of Communication Engineering, NCTU 17
1.4 Representation of Negative
Numbers
Department of Electrical Engineering, NCTU 18
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 For signed integer (both positive and negative integers), the first bit
in a word is used as a sign bit, with 0 for plus and 1 for minus
 There are 3 types of representations of negative numbers:
sign and magnitude, 2’s complement and 1’s complement
Department of Electrical Engineering, NCTU 19
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 Sign and magnitude:
For an n-bit word, the first bit, the most significant bit (MSB), is the
sign and the remaining n-1 bits represent the magnitude
Ex. 0011=+3, 1011=-3
 2’s complement:
 A positive number is represented by a 0 followed by the magnitude
 A negative number is represented by its 2’s complement N*:
N* = 2n –N
 1’s complement:
 A negative number, -N, is represented by its 1’s complement of N
defined as
 Notice
 Therefore, if
 N* = 2n –N
(2 1)n
N N  
2 1 111 11 (n bits)n
  
00110001100111  NN
00110011*
 NN
Department of Electrical Engineering, NCTU 20
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 Addition of 2’s complement numbers:
 E.g. 4-bit word, n = 4
5 –6 = –1
 5 + (2n –6) = 2n –1  2’s complement of 1
 So the addition is carried out just as if the numbers were positive
 The addition of two 4-bit words becomes a 5-bit word in general
 Do sign extension before addition
E.g. 5 + 6 = 11
By sign extension 5 = 00101, 6 = 00110
 5+6 = 01011
E.g. –5 –6 = –11
By sign extension, –5  24 –5 = 11010+1 = 11011
–6  24 –6 = 11001+1 = 11010
–11  25 –6 –5 = 10101  2’s complement of 11
Department of Electrical Engineering, NCTU 21
Logic Design Unit 1 Introduction Sau-Hsuan Wu
 Addition of 1’s complement numbers:
 Similar to 2’s complement except that instead of discarding the
last carry, it is added to the n-bit sum in the position furthest to
the right, least significant bit (LSB).
This is referred to as an end-around carry
 –A+B (B > A)  (2n 1 A) + B
= B A + (2n 1)  removing (2n 1)
 –A –B (A+B < 2n-1) 
(2n 1 A) + (2n 1 B) = [2n 1 (A+B)] + (2n 1)
 Similarly, do sign extension to protect from overflow
( 5) ( 6)
1010
0110
10000
1
0001
 
End-around carry

More Related Content

PPTX
Unit 4-booth algorithm
PPT
Digital Logic Design
PPT
Complements
PPT
adder and subtractor
PPTX
Design half ,full Adder and Subtractor
PPT
KARNAUGH MAP(K-MAP)
PPT
Minterm and maxterm
PPTX
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.
Unit 4-booth algorithm
Digital Logic Design
Complements
adder and subtractor
Design half ,full Adder and Subtractor
KARNAUGH MAP(K-MAP)
Minterm and maxterm
Logic gates - AND, OR, NOT, NOR, NAND, XOR, XNOR Gates.

What's hot (20)

PDF
Decoders
PPTX
Adder substracter
PPT
Arithmetic circuits
PPTX
SOP POS, Minterm and Maxterm
PPT
Digital Logic circuit
PPT
Digital Logic Circuits
PPTX
Decoder Full Presentation
PPTX
Half Subtractor.pptx
PPTX
Ring Counter.pptx
PPTX
Digital Electronics - Counters
PPT
KMAP
PPTX
Half adder and full adder
PPTX
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
PPTX
Counters
PPT
Algorithmic Notations
PPTX
Behavioral modelling in VHDL
PPTX
Combinational circuit
PPT
Adder and subtrctor DLD
PPTX
Booth’s algorithm.(a014& a015)
PPTX
Encoders and decoders
Decoders
Adder substracter
Arithmetic circuits
SOP POS, Minterm and Maxterm
Digital Logic circuit
Digital Logic Circuits
Decoder Full Presentation
Half Subtractor.pptx
Ring Counter.pptx
Digital Electronics - Counters
KMAP
Half adder and full adder
12.Representation of signed binary numbers. Binary codes - BCD code, Gray co...
Counters
Algorithmic Notations
Behavioral modelling in VHDL
Combinational circuit
Adder and subtrctor DLD
Booth’s algorithm.(a014& a015)
Encoders and decoders
Ad

Similar to Logic Design (20)

PDF
Module 4_Digital Electronics till complements.pdf
PPT
Comp Arithmetic Basic.ppt
PDF
IN 1300 LEC Basic electronic 1 Basic electronic 1 .pdf
PPSX
Unit-6 Computer Arithmetic.ppsx
PDF
Mazidi Presentation.pdf
PPT
DATA REPRESENTATION
PPT
DATA REPRESENTATIONS and Data codes and formats.ppt
PPT
An introduction to data_representation.ppt
PPTX
About the computer of the important field
PPTX
digital-systems-and-binary-numbers1.pptx
PPTX
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
PDF
Numbersystemsppt 181023140730
PPT
Number systems ppt
PPT
100_2_digitalSystem_Chap1 (2).ppt
PPTX
DLD-Introduction.pptx
PPT
Chapter_1_Digital_Systems_and_Binary_Numbers2.ppt
PPT
105_2_digitalSystem_Chap_3_part_3.ppt
PPT
digital systems and information
PPTX
Digital Electronics and Computer Language
Module 4_Digital Electronics till complements.pdf
Comp Arithmetic Basic.ppt
IN 1300 LEC Basic electronic 1 Basic electronic 1 .pdf
Unit-6 Computer Arithmetic.ppsx
Mazidi Presentation.pdf
DATA REPRESENTATION
DATA REPRESENTATIONS and Data codes and formats.ppt
An introduction to data_representation.ppt
About the computer of the important field
digital-systems-and-binary-numbers1.pptx
ESSENTIAL of (CS/IT/IS) class 03-04 (NUMERIC SYSTEMS)
Numbersystemsppt 181023140730
Number systems ppt
100_2_digitalSystem_Chap1 (2).ppt
DLD-Introduction.pptx
Chapter_1_Digital_Systems_and_Binary_Numbers2.ppt
105_2_digitalSystem_Chap_3_part_3.ppt
digital systems and information
Digital Electronics and Computer Language
Ad

More from Partha_bappa (13)

PPT
Alternative Vs Complementary Medicine
PDF
Unit 07
PDF
Unit 04
PDF
Unit 03
PDF
Unit 02
PDF
Digital Communication
PPTX
Media Literacy
PDF
Fourier supplementals
PDF
Biology questions answer
DOCX
INTERNAL Assign no 207( JAIPUR NATIONAL UNI)
DOCX
internal Assign no 206 ( JAIPUR NATIONAL UNI)
DOCX
INTERNATIONAL Assign no 205 (JAIPUR NATIONAL UNI)
DOCX
INTERNAL Assign no 4 ( JAIPUR INTERNAL UNI)
Alternative Vs Complementary Medicine
Unit 07
Unit 04
Unit 03
Unit 02
Digital Communication
Media Literacy
Fourier supplementals
Biology questions answer
INTERNAL Assign no 207( JAIPUR NATIONAL UNI)
internal Assign no 206 ( JAIPUR NATIONAL UNI)
INTERNATIONAL Assign no 205 (JAIPUR NATIONAL UNI)
INTERNAL Assign no 4 ( JAIPUR INTERNAL UNI)

Recently uploaded (20)

DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Welding lecture in detail for understanding
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
PPT on Performance Review to get promotions
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Sustainable Sites - Green Building Construction
PDF
Well-logging-methods_new................
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
composite construction of structures.pdf
PPT
Project quality management in manufacturing
PPTX
additive manufacturing of ss316l using mig welding
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Welding lecture in detail for understanding
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
UNIT-1 - COAL BASED THERMAL POWER PLANTS
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPT on Performance Review to get promotions
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Operating System & Kernel Study Guide-1 - converted.pdf
Sustainable Sites - Green Building Construction
Well-logging-methods_new................
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
OOP with Java - Java Introduction (Basics)
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
composite construction of structures.pdf
Project quality management in manufacturing
additive manufacturing of ss316l using mig welding
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx

Logic Design

  • 1. Department of Communication Engineering, NCTU 1 Unit 1 Introduction 1. Digital Systems 2. Number System and Conversion 3. Binary Arithmetic
  • 2. Department of Communication Engineering, NCTU 2 1.1 Digital Systems
  • 3. Department of Electrical Engineering, NCTU 3 Logic Design Unit 1 Introduction Sau-Hsuan Wu  Digital Systems:  A system that can perform data computation, storage and data input and output in digital formats  Why digital systems instead of analog systems?  Easy and reliable control of data precision (number of bits)  Easy and reliable circuit implementations (on/off switch)  Applications of Digital Systems:  Computation, data processing, signal acquisition and processing, automatic control, communications and measurements, etc Input/Output Interface Arithmetic/Logic Unit Data Storage Control Unit
  • 4. Department of Electrical Engineering, NCTU 4 Logic Design Unit 1 Introduction Sau-Hsuan Wu  Design of digital systems includes 3 phases:  System design: design functions to meet specific applications  Logic design : implement functions in logic gates  Circuit design : design and implement logic gates  System design involves functional definitions and system partitions. The aspect of system design varies a lot  Logic design means coming up with methods to implement the defined functions, using basic logic units  Circuit design here refers to the implementations of basic logic units such as AND, OR, Flip-Flops, etc. with resistors, diodes and transistors  We will not cover circuit design in this course
  • 5. Department of Electrical Engineering, NCTU 5 Logic Design Unit 1 Introduction Sau-Hsuan Wu  A simple digital system : Y = max { C, A+B}  If C > A+B Y=C else Y=A+B  A simple logic implementation of the above system Yes, C1=1 Start A+B > C Save Y No, C1=0 C2 A B C Adder Comp Mux Y C1 C2
  • 6. Department of Electrical Engineering, NCTU 6 Logic Design Unit 1 Introduction Sau-Hsuan Wu  Logic circuits can be categorized into two classes:  Combinational logic  Sequential Logic  Combinational logic’s outputs depend only on the present inputs:  E.g. Adder, multiplier, comparator, multiplexer  Sequential logic’s output depend on both the present and the past outputs. In general, a sequential circuit is composed of a combinational circuit with added memory elements.  E.g. C = A+B E = C+D F = CD
  • 7. Department of Communication Engineering, NCTU 7 1.2 Number Systems and Conversion
  • 8. Department of Electrical Engineering, NCTU 8 Logic Design Unit 1 Introduction Sau-Hsuan Wu  Base R representation of a rational number  Any positive integer R > 1 can be chosen as the base of a number  E.g. : converting an octal number to decimal 3 82 + 2 81 + 1 80 + 1 8-1 = 192 + 16 + 1 + 0.125 = 208.125 4 3 2 1 0 1 2 3 4 3 2 1 0 4 3 2 1 0 1 2 3 1 2 3 ( . ) 0 1i N a a a a a a a a a R a R a R a R a R a R a R a R a R                                    其中where
  • 9. Department of Electrical Engineering, NCTU 9 Logic Design Unit 1 Introduction Sau-Hsuan Wu  For bases greater than 10, more than 10 symbols are needed to represent the digits  Letters are usually used to represent digits greater than 9  E.g., for a hexadecimal number, we have digits 0,1,2,3,…9,A,B,C,D,E,F  E.g. : converting a hexadecimal to decimal A 162 + 2 161 + B 160 + F 16-1 = 10 256 + 2 16 + 11 + 15/16 = 2603.9375
  • 10. Department of Electrical Engineering, NCTU 10 Logic Design Unit 1 Introduction Sau-Hsuan Wu  Conversion of a decimal number to base R 10 2 For integer, 53 110101 53 2 26 1 26 2 13 0 13 2 6 1 6 2 3 0 3 2 1 1                 使用除法 10 2 For fraction, .625 .101 .625 2 1.25 1 .25 2 0.5 0 .5 2 1.0 1        使用乘法use division use multiplication
  • 11. Department of Electrical Engineering, NCTU 11 Logic Design Unit 1 Introduction Sau-Hsuan Wu  Conversion between two bases R1 & R2 other than decimal  Convert from base R1 to decimal first, then convert the decimal number to base R2 4 10 7231.3 45.75 63.5151 45 7 6 3 .75 7 5.25 5 .25 7 1.75 1 .75 7 5.25 5            
  • 12. Department of Communication Engineering, NCTU 12 1.3 Binary Arithmetic
  • 13. Department of Electrical Engineering, NCTU 13 Logic Design Unit 1 Introduction Sau-Hsuan Wu  Arithmetic operations in digital systems are usually done in binary because design of logic circuits to perform binary arithmetic is much simpler than decimal arithmetic  We only need switches: On  1, OFF  0  Binary addition 0 0 0 0 1 1 1 0 1 1 1 0 carry 1 to the next column         10 10 10 Ex. 1111 carries 13 = 1101 11 = 1011 24 11000 
  • 14. Department of Electrical Engineering, NCTU 14 Logic Design Unit 1 Introduction Sau-Hsuan Wu  Binary subtraction 0 0 0 0 1 1 borrow 1 from the next column 1 0 1 1 1 0         Ex. 1 borrow 11101 10011 1010  
  • 15. Department of Electrical Engineering, NCTU 15 Logic Design Unit 1 Introduction Sau-Hsuan Wu  Binary multiplication 0 0 0 0 1 0 1 0 0 1 1 1         Ex. 1101 1011 1101 1101 0000 1101 10001111 
  • 16. Department of Electrical Engineering, NCTU 16 Logic Design Unit 1 Introduction Sau-Hsuan Wu  Binary division is similar to decimal division Ex. 1101 1011 10010001 1011 1110 1011 1101 1011 10
  • 17. Department of Communication Engineering, NCTU 17 1.4 Representation of Negative Numbers
  • 18. Department of Electrical Engineering, NCTU 18 Logic Design Unit 1 Introduction Sau-Hsuan Wu  For signed integer (both positive and negative integers), the first bit in a word is used as a sign bit, with 0 for plus and 1 for minus  There are 3 types of representations of negative numbers: sign and magnitude, 2’s complement and 1’s complement
  • 19. Department of Electrical Engineering, NCTU 19 Logic Design Unit 1 Introduction Sau-Hsuan Wu  Sign and magnitude: For an n-bit word, the first bit, the most significant bit (MSB), is the sign and the remaining n-1 bits represent the magnitude Ex. 0011=+3, 1011=-3  2’s complement:  A positive number is represented by a 0 followed by the magnitude  A negative number is represented by its 2’s complement N*: N* = 2n –N  1’s complement:  A negative number, -N, is represented by its 1’s complement of N defined as  Notice  Therefore, if  N* = 2n –N (2 1)n N N   2 1 111 11 (n bits)n    00110001100111  NN 00110011*  NN
  • 20. Department of Electrical Engineering, NCTU 20 Logic Design Unit 1 Introduction Sau-Hsuan Wu  Addition of 2’s complement numbers:  E.g. 4-bit word, n = 4 5 –6 = –1  5 + (2n –6) = 2n –1  2’s complement of 1  So the addition is carried out just as if the numbers were positive  The addition of two 4-bit words becomes a 5-bit word in general  Do sign extension before addition E.g. 5 + 6 = 11 By sign extension 5 = 00101, 6 = 00110  5+6 = 01011 E.g. –5 –6 = –11 By sign extension, –5  24 –5 = 11010+1 = 11011 –6  24 –6 = 11001+1 = 11010 –11  25 –6 –5 = 10101  2’s complement of 11
  • 21. Department of Electrical Engineering, NCTU 21 Logic Design Unit 1 Introduction Sau-Hsuan Wu  Addition of 1’s complement numbers:  Similar to 2’s complement except that instead of discarding the last carry, it is added to the n-bit sum in the position furthest to the right, least significant bit (LSB). This is referred to as an end-around carry  –A+B (B > A)  (2n 1 A) + B = B A + (2n 1)  removing (2n 1)  –A –B (A+B < 2n-1)  (2n 1 A) + (2n 1 B) = [2n 1 (A+B)] + (2n 1)  Similarly, do sign extension to protect from overflow ( 5) ( 6) 1010 0110 10000 1 0001   End-around carry