Systems I: Computer Organization and Architecture

Similar documents
COMBINATIONAL LOGIC FUNCTIONS

Chapter 4. Combinational: Circuits with logic gates whose outputs depend on the present combination of the inputs. elements. Dr.

Combinational Logic. By : Ali Mustafa

Combinational Logic. Course Instructor Mohammed Abdul kader

Logic. Combinational. inputs. outputs. the result. system can

Combinational Logic. Mantıksal Tasarım BBM231. section instructor: Ufuk Çelikcan

Digital System Design Combinational Logic. Assoc. Prof. Pradondet Nilagupta

UNIT II COMBINATIONAL CIRCUITS:

Chapter 4: Combinational Logic Solutions to Problems: [1, 5, 9, 12, 19, 23, 30, 33]

Adders - Subtractors

Combinational Logic. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C.

Combinational Logic. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C.

CHAPTER1: Digital Logic Circuits Combination Circuits

Logic and Computer Design Fundamentals. Chapter 5 Arithmetic Functions and Circuits

Review for Test 1 : Ch1 5

ELCT201: DIGITAL LOGIC DESIGN

Combina-onal Logic Chapter 4. Topics. Combina-on Circuit 10/13/10. EECE 256 Dr. Sidney Fels Steven Oldridge

Class Website:

MC9211 Computer Organization

Lecture 2 Review on Digital Logic (Part 1)

Z = F(X) Combinational circuit. A combinational circuit can be specified either by a truth table. Truth Table

Carry Look Ahead Adders

Boolean Algebra, Gates and Circuits

PG - TRB UNIT-X- DIGITAL ELECTRONICS. POLYTECHNIC-TRB MATERIALS

Digital Logic Design ENEE x. Lecture 14

Number System. Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary

Combinational Logic. Jee-Hwan Ryu. School of Mechanical Engineering Korea University of Technology and Education

IT T35 Digital system desigm y - ii /s - iii

ELCT201: DIGITAL LOGIC DESIGN

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

MODULAR CIRCUITS CHAPTER 7

UNIVERSITI TENAGA NASIONAL. College of Information Technology

Save from: cs. Logic design 1 st Class أستاذ المادة: د. عماد

Chapter 5 Arithmetic Circuits

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System?

Combinational Logic Design Arithmetic Functions and Circuits

Lecture 5: NAND, NOR and XOR Gates, Simplification of Algebraic Expressions

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

Lecture 6: Manipulation of Algebraic Functions, Boolean Algebra, Karnaugh Maps

Review: Additional Boolean operations

CHAPTER 7. Exercises 17/ / /2 2 0

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

211: Computer Architecture Summer 2016

CSE 140L Spring 2010 Lab 1 Assignment Due beginning of the class on 14 th April

Gate-Level Minimization

UNIT 4 MINTERM AND MAXTERM EXPANSIONS

BOOLEAN ALGEBRA. Introduction. 1854: Logical algebra was published by George Boole known today as Boolean Algebra

Unit 2 Session - 6 Combinational Logic Circuits

Chap 2. Combinational Logic Circuits

ELEN Electronique numérique

Binary addition by hand. Adding two bits

Binary addition example worked out

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations.


Part 1: Digital Logic and Gates. Analog vs. Digital waveforms. The digital advantage. In real life...

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

Midterm Exam Two is scheduled on April 8 in class. On March 27 I will help you prepare Midterm Exam Two.

Chapter 4: Designing Combinational Systems Uchechukwu Ofoegbu

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Lecture 6: Gate Level Minimization Syed M. Mahmud, Ph.D ECE Department Wayne State University

Digital Systems and Information Part II

ECE 545 Digital System Design with VHDL Lecture 1. Digital Logic Refresher Part A Combinational Logic Building Blocks

Digital Electronics Circuits 2017

ELECTRONICS & COMMUNICATION ENGINEERING PROFESSIONAL ETHICS AND HUMAN VALUES

UNIT 1. BOOLEAN ALGEBRA AND COMBINATIONAL CIRCUITS

ECE 2300 Digital Logic & Computer Organization

KUMARAGURU COLLEGE OF TECHNOLOGY COIMBATORE

II. COMBINATIONAL LOGIC DESIGN. - algebra defined on a set of 2 elements, {0, 1}, with binary operators multiply (AND), add (OR), and invert (NOT):

Digital Logic (2) Boolean Algebra

CS 121 Digital Logic Design. Chapter 2. Teacher Assistant. Hanin Abdulrahman

CMSC 313 Lecture 17. Focus Groups. Announcement: in-class lab Thu 10/30 Homework 3 Questions Circuits for Addition Midterm Exam returned

SAU1A FUNDAMENTALS OF DIGITAL COMPUTERS

Midterm Examination # 1 Wednesday, February 25, Duration of examination: 75 minutes

Chapter 3 Combinational Logic Design

CSCI 220: Computer Architecture-I Instructor: Pranava K. Jha. BCD Codes

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Section 3: Combinational Logic Design. Department of Electrical Engineering, University of Waterloo. Combinational Logic

Introduction to Digital Logic Missouri S&T University CPE 2210 Subtractors

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6201 DIGITAL PRINCIPLES AND SYSTEM DESIGN

14:332:231 DIGITAL LOGIC DESIGN

Digital Techniques. Figure 1: Block diagram of digital computer. Processor or Arithmetic logic unit ALU. Control Unit. Storage or memory unit

Chapter 2. Boolean Algebra and Logic Gates

COMBINATIONAL LOGIC CIRCUITS. Dr. Mudathir A. Fagiri

Chapter 7 Logic Circuits

Design of Sequential Circuits

CMSC 313 Lecture 18 Midterm Exam returned Assign Homework 3 Circuits for Addition Digital Logic Components Programmable Logic Arrays

( c) Give logic symbol, Truth table and circuit diagram for a clocked SR flip-flop. A combinational circuit is defined by the function

ENG2410 Digital Design Combinational Logic Circuits

Contents. Chapter 3 Combinational Circuits Page 1 of 36

Logic Simplification. Boolean Simplification Example. Applying Boolean Identities F = A B C + A B C + A BC + ABC. Karnaugh Maps 2/10/2009 COMP370 1

EC-121 Digital Logic Design

Chapter 2. Digital Logic Basics

Sample Test Paper - I

Logic Gate Level. Part 2

Hardware Design I Chap. 4 Representative combinational logic

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

Digital Logic Appendix A

COSC 243. Introduction to Logic And Combinatorial Logic. Lecture 4 - Introduction to Logic and Combinatorial Logic. COSC 243 (Computer Architecture)

Chapter 1 CSCI

Transcription:

Systems I: Computer Organization and Architecture Lecture 6 - Combinational Logic Introduction A combinational circuit consists of input variables, logic gates, and output variables. The logic gates accept n input signals and generate the m signals that become output. For n input variables, there are 2 n possible combinations of binary input values. For each input combination, there will be one and only possible output combination. Each input will have one or two wires. If there is one wire, it will be either in the normal (unprimed) form or the complemented (primed) form. If there are two wires, it will supply both forms.

Block Diagram for a Combinational Circuit n input variables Combinational Logic Circuit m output variables Combinational Circuit Analysis Analysis of a combinational circuit requires that we find the function(s) that the circuit implements. First we must ensure that the circuit is combinational and not sequential. (The lack of feedback paths or memory elements ensures that). After this, we try to find the logic function or truth table.

Analysis Procedure. Label all gate outputs that are a function of input variables with arbitrary symbols. Determine the Boolean functions for each gate output. 2. Label the gates that are a function of input variables and previously labeled gates with other arbitrary symbols. Find the Boolean functions for these gates. 3. Repeat the process outlined in step 2 until the outputs of the circuits are obtained. 4. By repeated substitution of previously defined functions, obtain the output Boolean functions in terms of input variables. T 2 Analysis Example A F B T T 3 C F 2 F 2

Analysis Example The Outputs We initially get: F 2 = AB + AC + BC T = A + B + C T 2 = ABC Next, we consider the outputs of gates that are a function of symbol that are already defined: T 3 = F 2 T F = T 3 + T 2 Analysis Example Solving For F F = T 3 + T 2 = F 2 T + ABC = (AB + AC + BC) (A + B + C) + ABC = (A +B )(A +C )(B +C )(A + B + C) + ABC = (A + B C )(AB +AC + BC + B C) + ABC = A BC + A B C + AB C + ABC

The Truth Table for F F T 3 T 2 T F 2 F 2 C B A Design Procedure The design procedure starts with the verbal outline of the problem and ends with a logic circuit diagram or a set of Boolean functions from which the circuit diagram can be created.

The Steps in the Design Procedure The procedure involves these steps:. The problem is stated. 2. The number of available input variables and required output variables is determined. 3. The input and output variables are assigned letter symbols. 4. The truth tables that defines the required relationships between inputs and outputs are derived. 5. The simplified Boolean function for each output is obtained. 6. The logic diagram is drawn. The Truth Table The truth table consists of input and output columns. The s and s for the input are obtained from the 2 n combinations of n input variables. An output could be either or for every valid input combination. Some input combinations will not occur; these become don t-care conditions.

Simplifying the Boolean Functions The output functions are simplified by Boolean algebra, Karnaugh maps or tabulation. There will usually more than one simplified expression to choose from. Which expression we choose may depend on circuit design constraints such as : Minimum number of gates Number of input to a gate Minimum propagation time of the signal through the circuit. Minimum number of interconnections Limitation of the driving capabilities of each gates. Code Conversion From BCD to Excess-3 BCD (Binary-Coded Decimal) and Excess- 3 provide two different ways of representing a decimal value in a binary format. There will be a one-to-one correspondence between BCD inputs and the corresponding Excess-3 values. Not all the BCD minterms are valid values. These will lead to don t-care conditions.

Truth Table for BCD to Excess-3 z y x w D C B A BCD Inputs Excess-3 Outputs Karnaugh Map for w CD AB X X X X X X C A D B w = A + BC + BD

Karnaugh Map for x C AB CD A X X X X X X B D x = B C + B D + BC D Karnaugh Map for y C AB CD A X X X X X X B D y = CD + C D

Karnaugh Map for z C AB CD A X X X X X X B D z = D Circuit Diagram for BCD to Excess-3 D C D CD z y B C+D (C+D) x A w

Half Adder The most basic arithmetic operation is the addition of two binary digits. We know that: + = + = + = + = If both addends are, we need a carry bit which will be added to the addend in the next more significant bit. Half Adder (continued) We can summarize this in the form of a truth table: x y C S From this we learn that: S = x y + xy = x y C = xy

Implementation of Half Adder x y C S S = x y + xy C = xy Implementing a Half Adder Using XOR x y C S S = x y C = xy

Implementing a Half Adder As a Product of Sums x y C S S = (x+y)(x +y ) C = xy Implementing a Half Adder As a Product of Sums x y S C S = (x+y)(x +y ) C = (x +y )

Implementing a Half Adder x y C S C = xy S = (C + x y ) The Full Adder A full adder is a combinational circuit that forms the arithmetic sum of three inputs. It consists of 3 inputs and two outputs. Two of the inputs (x and y) are the same as in the half adder. The third input (z) is the carry from the addition of the previous (lesser significance) bits.

Truth table for a full adder S C z y x Karnaugh Maps for Full Adder yz x yz x S = x y z + x y z + x y z + xyz C = xy + xz + yz

Full Adder Circuit Diagram For the Sum x y z S Full Adder Circuit Diagram For the Carry x y z C

Full Adder Circuit Diagram Using Half Adders x y S C S = z ( x y) z C = z ( x y) + x y Block Diagram For Adders A HA C Half Adder B S C i A i B i FA C i+ S Full Adder

Binary Adder A binary adder is a digital circuit that produces the arithmetic sum of two binary numbers. It can be constructed by connecting a series of full adders in cascade. 4 Bit Adder B 3 A 3 B 2 A 2 B A B A FA C 3 FA C 2 FA C FA C 4 C S 3 S 2 S S

4-Bit Adder An Example Subscript i 3 2 C i Input Carry A i Augend B i Augend C i Sum S i Output Carry C i+ Carry Propagation Adding two binary numbers in parallel implies that we have all the bits that we need available at the same time. The cascading of carries seems to belie this assumption. If we can generate the necessary bits to determine carries in parallel, then we can actually do the summation without waiting for a carry to cascade through.

Carry Propagation We can add two additional terms: G i Carry Generate P i Carry Propagate We can define them as: P i = A i B i G i = A i B i The output sum and carry are now: S i = P i G i C i+ = G i + P i C i Carries in a Carry Lookahead Generator C = input carry C = G + P C C 2 = G + P C = G + P (G + P C ) = G + P G + P P C C 3 = G 2 + P 2 C 2 = G 2 + P 2 G + P 2 P G + P 2 P P C

Carry Lookahead Generator C 3 P 2 G 2 C 3 P G P G C C 3 3-Bit Adder with Carry Generator B 2 P 2 C 3 C 3 A 2 G 2 C 2 P 2 S 2 B 2 P Carry A 2 G C Lookahead P S B A P Generator G P S C

Half Subtractor A half subtractor subtracts two bits and produces their difference and whether a was borrowed. We must remember that: = ; = ; and = If we have, we must borrow from the next place, so our difference is with a borrow of. Truth Table for the Half Subtractor x y B D D = x y + xy = x y B = x y

Full Subtractor A full subtractor performs subtraction between two bits takinginto account the potential borrow from a lower significance bit. A full subtractor s inputs are x, the minuend y, the subtrahend z, the borrow Truth Table for the Half Subtractor D B z y x

Karnaugh Maps for Full Subtractor x yz D = x y z + x y z + x y z + xyz yz x B = x y + x z + yz Adder-Subtracter Subtracting A B is most easily done by adding B to A and then adding. This makes it convenient to combine both addition and subtraction into one circuit, called an addersubtracter. M is the mode indicator M = indicates addition (B is left alone and C is ) M = indicates subtraction (B is complement and C is ).

4-Bit Adder-Subtractor B 3 A 3 B 2 A 2 B A B A M C 3 C 2 C FA FA FA FA C S 3 S 2 C 4 S S Overflow If addition of 2 n-bit augends produces an n+-bit sum, we say that overflow occurs. Overflow is a problem for computers if undetected because the answer that is produced is erroneous.

Examples Of No Overflow Carry out of sign bit Carry into sign bit Carries: +7 +7-8 +2 - +9 If there is no overflow, the carry into the sign bit matches the carry out of the sign bit. Examples Of Overflow Carry out of sign bit Carry into sign bit Carries: +7-7 +8-8 +5-5 If there is overflow, the carry into the sign bit does not match the carry out of the sign bit.

4-Bit Adder-Subtractor With Overflow Output B 3 A 3 B 2 A 2 B A B A M C 3 C 2 C FA FA FA FA C C 4 S S 3 S 2 S V If V =, there is overflow If V =, there is no overflow Decimal Adder Some systems perform arithmetic on decimal values, which are stored in BCD form. A decimal adder requires 9 inputs: 4 bits for each decimal digit of the augend and a carry bit. The easiest way to construct a decimal adder is by using a binary adder and then convert the sum to decimal form. The five inputs are K (the binary carry), Z 8, Z 4, Z 2 and Z. The five outputs are C (the decimal carry), S 8, S 4, S 2 and S.

The Truth Table for the BCD Adder Binary Sum BCD Sum Decimal K Z 8 Z 4 Z 2 Z C S 8 S 4 S 2 S 2 3 4 5 6 7 8 9 The Truth Table for the BCD Adder Binary Sum BCD Sum Decimal K Z 8 Z 4 Z 2 Z C S 8 S 4 S 2 S 2 3 4 5 6 7 8 9

BCD Adder Addend Augend Carry in K 4-bit Binary Adder Carry in Z 8 Z 4 Z 2 Z Output Carry 4-bit Binary Adder S 8 S 4 S 2 S Binary Multiplier Binary multiplication is performed the same way as decimal multiplication, except each line is either the multiplicand shifted or all zeros, depending on whether the multiplier bit is or. Example: B B A A A B A B A B A B C 3 C 2 C C

2-Bit Multiplier A B B A HA HA C 3 C 2 C C 4-Bit by 3-bit Multiplier A A B 3 B 2 B B B 3 B 2 B B A 2 B 4 bit Adder C Sum B 3 B 2 B 4 bit Adder C 6 C 5 C 4 C 3 C 2 C C

Magnitude Comparator A magnitude comparator is a combinational circuit that compares two numbers, A and B and determines their relative magnitudes. The output is three variables that indicate whether A = B, A > B or A < B. Magnitude Comparator The Algorithm If A = A 3 A 2 A A and B = B 3 B 2 B B then if we define x i = A i B i + A i B i where i =,, 2, 3 A = B when x 3 x 2 x x = (A > B) = A 3 B 3 + x 3 A 2 B 2 + x 3 x 2 A B + x 3 x 2 x A B (A < B) = A 3 B 3 + x 3 A 2 B 2 + x 3 x 2 A B + x 3 x 2 x A B

Magnitude Comparator The Circuit A 3 x 3 B 3 A 2 x 2 A < B B 2 A x A > B B A B A = B Decoders A decoder is a combinational circuits that converts binary information from the n coded inputs to a maximum of 2 n unique outputs. The decoders in which that we are interested are n- to-m-line decoders, where 2 n m. Commercial decoders usually include an enable input, without which there is no response from the decoder.

Truth Table For For a 3-to-8-Line Decoder Enable Inputs Outputs E A 2 A A D 7 D 6 D 5 D 4 D 3 D 2 D D X X X 3-to-8 Decoder A 2 D A D D 2 A D 3 D 4 D 5 D 6 D 7 E

NAND Gate Decoder Some decoders are constructed with NAND gates instead of AND gates. Since NAND gates invert the outputs, it is more economical to invert the signals, i.e., E has a value to enable the circuit and to disable, and there is only one output D i with a value of. 2-to-4-Line NAND Gate Decoder Truth Table E A A D D D 2 D 3 X X

A 2-to-4 Decoder With NAND Gates D D A D 2 D 3 E Expanding Decoders Sometimes a decoder may be needed but only smaller decoders are available. Take the example of using 2-to-4 decoders to build a 3-to-8 decoder: The less significant inputs are attached to both decoders. A 2 is used as E for the lower decoder and E in the higher decoder.

3-to-8 Decoder Constructed With Two 2-to-4 Decoders A A A 2 2 x 4 decoder 2 2 E D D D 2 D 3 2 x 4 decoder 2 2 E D 4 D 5 D 6 D 7 Implementing A Full Adder With a Decoder x 2 2 2 S y z 2 2 3 4 5 6 C 7

Encoders An encoder does the opposite of a decoder An encoder has 2 n (or less) inputs and n outputs. An encoder can be implemented using OR gates whose inputs are determined from the truth table.: A = D + D 3 + D 5 + D 7 A = D 2 + D 3 + D 6 + D 7 A2 = D 4 + D 5 + D 6 + D 7 Encoders D D D 2 A D 3 D 4 A D 5 D 6 A 2 D 7

Priority Encoder A priority encode is an encoder with a priority function. If two or more inputs are both set, the input with the highest priority takes precedence. The outputs x and y indicate the encoded bit; the output V is a valid bit indicator, which is set when one or more bits are set to. Truth Table For A Priority Encoder Inputs Outputs D D D 2 D 3 x y V X X X X X X X X

D D D 2 D 3 Karnaugh Map for X X D 2 D 3 D 2 D 3 Karnaugh Map for Y D D X D D 2 D 3

4-input Priority Encoder D 3 D 2 y D x V D Multiplexers A multiplexer allows 2 n input lines to share a single output line. The line currently using the common output line is indicated by the select line inputs. The select lines are decoded to determine which input has use of the line. A 4-to--line multiplexer has six inputs (four data inputs and two select inputs and one output). The truth table would require 64 lines. It is more efficient and just as informative to use a function table, where we indicate by function what the output will be.

4-to--Line Multiplexer I I I 2 Y I 3 S S 4-to--Line Multiplexer Function Table Select Output S S Y I I I 2 I 3

Quadruple 2-to- Line Multiplexer Enable Select A A A 2 A 3 B B B 2 B 3 Quadruple 2 x multiplexer Y Y Y 2 Y 3