Menu. Binary Adder EEL3701 EEL3701. Add, Subtract, Compare, ALU

Similar documents
COMBINATIONAL LOGIC FUNCTIONS

Adders - Subtractors

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

Menu. Excitation Tables (Bonus Slide) EEL3701 EEL3701. Registers, RALU, Asynch, Synch

Systems I: Computer Organization and Architecture

Chapter 03: Computer Arithmetic. Lesson 03: Arithmetic Operations Adder and Subtractor circuits Design

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

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Combinational Logic. By : Ali Mustafa

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

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

Combinational Logic Design Arithmetic Functions and Circuits

Menu. 7-Segment LED. Misc. 7-Segment LED MSI Components >MUX >Adders Memory Devices >D-FF, RAM, ROM Computer/Microprocessor >GCPU

Binary addition by hand. Adding two bits

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

Chapter 5 Arithmetic Circuits

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

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

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

Latches. October 13, 2003 Latches 1

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

Combinational Logic. Course Instructor Mohammed Abdul kader

ว ตถ ประสงค ของบทเร ยน

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

ELCT201: DIGITAL LOGIC DESIGN

Binary addition (1-bit) P Q Y = P + Q Comments Carry = Carry = Carry = Carry = 1 P Q

Overview. Arithmetic circuits. Binary half adder. Binary full adder. Last lecture PLDs ROMs Tristates Design examples

Chapter 4: Designing Combinational Systems Uchechukwu Ofoegbu

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

Carry Look Ahead Adders

Looking at a two binary digit sum shows what we need to extend addition to multiple binary digits.

ECE/CS 250 Computer Architecture

CHAPTER1: Digital Logic Circuits Combination Circuits

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

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design Boolean Algebra, Logic Gates

Experiment 7: Magnitude comparators

EECS150 - Digital Design Lecture 10 - Combinational Logic Circuits Part 1

ALUs and Data Paths. Subtitle: How to design the data path of a processor. 1/8/ L3 Data Path Design Copyright Joanne DeGroat, ECE, OSU 1

Class Website:

Digital Logic and Design (Course Code: EE222) Lecture 1 5: Digital Electronics Fundamentals. Evolution of Electronic Devices

Please read carefully. Good luck & Go Gators!!!

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

UNIT 8A Computer Circuitry: Layers of Abstraction. Boolean Logic & Truth Tables

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

ECE 2300 Digital Logic & Computer Organization

CS61C : Machine Structures

mith College Computer Science CSC270 Spring 16 Circuits and Systems Lecture Notes Week 2 Dominique Thiébaut

CSE140: Components and Design Techniques for Digital Systems. Decoders, adders, comparators, multipliers and other ALU elements. Tajana Simunic Rosing

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Digital Logic

Module 2. Basic Digital Building Blocks. Binary Arithmetic & Arithmetic Circuits Comparators, Decoders, Encoders, Multiplexors Flip-Flops

University of Florida EEL 3701 Fall 1996 Dr. Eric M. Schwartz

CMP 334: Seventh Class

CS61C : Machine Structures

Addition and Subtraction

Fundamentals of Digital Design

Digital Logic. CS211 Computer Architecture. l Topics. l Transistors (Design & Types) l Logic Gates. l Combinational Circuits.

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

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

SIR C.R.REDDY COLLEGE OF ENGINEERING ELURU DIGITAL INTEGRATED CIRCUITS (DIC) LABORATORY MANUAL III / IV B.E. (ECE) : I - SEMESTER

14:332:231 DIGITAL LOGIC DESIGN

UNIT II COMBINATIONAL CIRCUITS:

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

DIGITAL LOGIC CIRCUITS

Combinational Logic. Review of Combinational Logic 1

Additional Gates COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

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

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

Theory of Logic Circuits. Laboratory manual. Exercise 1

COE 202: Digital Logic Design Combinational Circuits Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Every time has a value associated with it, not just some times. A variable can take on any value within a range

High Speed Time Efficient Reversible ALU Based Logic Gate Structure on Vertex Family

UNSIGNED BINARY NUMBERS DIGITAL ELECTRONICS SYSTEM DESIGN WHAT ABOUT NEGATIVE NUMBERS? BINARY ADDITION 11/9/2018

EEL 3701 Fall Multiply out the following logic expressions to obtain the Sum of Products.

ELEN Electronique numérique

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

Adders, subtractors comparators, multipliers and other ALU elements

CprE 281: Digital Logic

Total Time = 90 Minutes, Total Marks = 50. Total /50 /10 /18

CMPUT 329. Circuits for binary addition

04. What is the Mod number of the counter circuit shown below? Assume initially reset.

S.Y. Diploma : Sem. III [CO/CM/IF/CD/CW] Digital Techniques s complement 2 s complement 1 s complement

Lecture 2 Review on Digital Logic (Part 1)

211: Computer Architecture Summer 2016

Outcomes. Spiral 1 / Unit 2. Boolean Algebra BOOLEAN ALGEBRA INTRO. Basic Boolean Algebra Logic Functions Decoders Multiplexers

WEEK 3.1 MORE ON KARNAUGH MAPS

Adders, subtractors comparators, multipliers and other ALU elements

Design of Combinational Logic

NTE74LS181 Integrated Circuit TTL Arithmetic Logic Unit/Function Generator

Digital Electronics Circuits 2017

Digital Logic (2) Boolean Algebra

Unit 2 Session - 6 Combinational Logic Circuits

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

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

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

Number representation

ENGIN 112 Intro to Electrical and Computer Engineering

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

Logic Design. Chapter 2: Introduction to Logic Circuits

Logic Gate Level. Part 2

Chapter 7 Logic Circuits

Transcription:

Other MSI Circuit: Adders >Binar, Half & Full Canonical forms Binar Subtraction Full-Subtractor Magnitude Comparators >See Lam: Fig 4.8 ALU Menu Look into m... 1 Binar Adder Suppose we want to add two 2-bit numbers Sum 1 0 1 1 +0 1 0 1 0 1 Carr Carr Sum = /X Y + X /Y = X Y Carr = X Y 2 1

Notation for Binar Addition Notation: A 4-bit number is represented b b 3 b 2 b 1 b 0. Thus, we get bits b 0 ~b N-1 where N = # of bits. If we add two 4-bit numbers, what must we do bit b bit? c 3 c 2 c 1 c 0 = 0 c i = carr bit 3 2 1 0 i = 1 st number 3 2 1 0 i = 2 nd number c 4 s 3 s 2 s 1 s 0 s i = sum For the circuit with no carr in, we implement as follows: i s i i s i = i i c i+1 = i i c i+1 This circuit is called a Half-Adder 3 Adder with Carr Input Let us include a carr input ( ) in the design: Sum = /*/* + /* */ + */*/ + * * Sum c out When = 0, Sum cin =0 = When = 1, Sum cin =1 = /( ) Sum = Sum cin =1 + Sum cin =0 / Sum = /( ) + ( ) / Let W= Then Sum = /W + W / = W Sum = 4 2

Let s do C out : c out Q: Is the order important? Q: Wh? Carr Out of Full Adder Sum of all possible pairs c out = + + Sum = s i = c i & c out = c i+1 Sum c out XOR of all inputs Sum= i i c i Canonical.cct This circuit is called a Full-Adder s FA c o s i c i+1 5 Y 3 X 3 C 3 Ripple-Carr Adders Thus, to add two 4-bit numbers we need 4 Full- Adders as follows: Y 2 X 2 C 2 Y 1 X 1 C 1 Y 0 X 0 C 0 =0 FA 0 (C 0 =0) FA 3 FA 2 FA OR 1 HA (no C 0 ) C 4 S 3 C 3 S 2 C 2 S 1 C 1 S 0 Actuall, we could replace FA 0 with a half-adder 74 283 is a 4-bit look-ahead carr adder 6 3

Levels of Logic What if ou don t have XOR gates? X Y = /X Y + X /Y /X Two level logic Y X X Y /Y If ou need 3-input adder (and 3-input XOR), then: X Y C i Four level logic...wh? X Y C i 7 Sum Circuit But from K-map (or truth table) we can implement as sum of 4 minterms. Sum = /*/* + /* */ + */*/ + * * = What if ou onl have NAND gates? AND-OR Canonical.cct NAND-NAND 8 4

Canonical Forms: AND-OR = NAND-NAND MSOP = Minimum Sum of Product = An OR of AND terms good (mied-logic) form bad (P-logic) form Canonical.cct 9 c out Addition Eample Eample: Let c out = + + good (miedlogic) form c out Similarl, MPOS: OR-AND = NOR-NOR good (miedlogic) form bad (P-logic) form Canonical.cct c out bad (P-logic) form 10 5

Binar Subtraction If we subtract two 4-bit numbers, what must we do bit b bit? b 3 b 2 b 1 b 0 = 0 b i = borrow in m 3 m 2 m 1 m 0 m i = minuend s 3 s 2 s 1 s 0 s i = subtrahend b 4 d 3 d 2 d 1 d 0 d i = difference Consider the following: B i 0 0 0 0 0 1 1 1 0 0 1 1 0 1 0 M i 1 1 1 1 0 0 0 0 1 0 1 0 S i -1 0 1 0-1 0 1 0-1 1 0 1 D i 0 1 0 1 0 1 1 0 1 1 0 1 m i s i b i -2 4 +2 2 +2 1 =-10-2 4 + 2 3 +2 2 +2 0 =-3 FS d i b i+1 11 Subtraction Equations d i = m i s i b i b i+1 = /m i s i + /m i b i + s i b i d i b i+1 For a full adder we had previousl: s i = i i c i c i+1 = i i + i c i + i c i 12 6

Full Subtractor using Full Adder Suppose we let i =/m i in the Full Adder equation s i = i i c i then s i = /m i i c i c i+1 = i i + i c i + i c i then c i+1 = /m i i + /m i c i + i c i /s i = m i i c i then d i = /s i = m i s i b i m i s i b i i s i c i b i b i+1 = /m i s i + /m i b i + s i b i s i FS c i+1 d i b i+1 m i s i b i s i FA c i+1 Same! d i b i+1 13 FS using FA and K-maps Can also derive the same result using K-maps: >Let a i =/m i, b i =s i & c i =b i sum /diff /diff carr borrow K-maps for a FS for /d i and b i+1 m i s i d i m i i s i s i FS b c i+1 b i i+1 s i i FA b c i i c i+1 Alternative: Change m i and d i to active-low d i b i+1 14 7

We want a device to compare two binar numbers A & B and tell us: > (1) if A > B > (2) if A < B > (3) if A=B A A>B 2 A=B B 2 A<B Lam: Fig. 4.7 Magnitude Comparators 15 Magnitude Comparator K-Map We want a device to compare two binar numbers A & B and tell us: > (1) if A > B (2) if A < B (3) if A=B A A>B 2 A=B B 2 A<B Lam: Fig. 4.7 16 8

2-bit Magnitude Comparator Realization Lam: Fig. 4.7 17 A A>B B 4 4-bit Magnitude Comparators 4 A=B A<B Suppose A & B are 4 bit numbers. What is the corresponding size of the K-Map? A = a 3 a 2 a 1 a 0 B = b 3 b 2 b 1 b 0 Hence, 8 inputs! 8-variable K-Map is a mess! (A=B) = /(A>B) /(A<B) (A>B) = /(A=B) /(A<B) (A<B) = /(A>B) /(A=B) It takes 2 independent outputs and we can get the third from the 2. Note: A = B cannot be simplified. A>B or A<B seem (and are) rotations/reflections of the same map. 18 9

4-bit Mag Comparator (74 85) 4 A 4 B (A>B) OUT (A=B) OUT (A<B) OUT Cascading comparators (A>B) IN (A=B) IN (A<B) IN See Lam: Fig 4.8 19 4-bit Mag Comparator (74 85) See Lam: Fig 4.8 4 A 4 B (A>B) IN (A=B) IN (A<B) IN (A>B) OUT (A=B) OUT (A<B) OUT 20 10

Arithmetic-Logic Units (ALU s) ALU s are at the heart of CPU s - The are the combinational circuit elements that perform common functions: A set of logical functions & a set of arithmetic functions. See figures on net 2 pages [Eample] Let a computer instruction to complement the A register be COMA. The instruction COMA must do the following 3 things: (a) Connect the output of the A register to the A input of the ALU. (b) Present the ALU with control signals: M = H, S 0 = L, S 1 = L, S 2 = L, and S 3 = L. (c) Wait an appropriate dela and connect the output of the ALU (F 3 -F 0 ) to the input of the A register to reload the A register. 21 Lam Fig 6.1 ALU (74 181) Active-High View 22 11

Lam Fig 6.1 ALU (74 181) Active-Low View 23 Arithmetic-Logic Units (ALU s) ALU s are at the heart of CPU s - The are the combinational circuit elements that perform common functions: A set of logical functions & a set of arithmetic functions. See figures on previous 2 pages [Eample] Let a computer instruction to complement the A register be COMA. The instruction COMA must do the following 3 things: (a) Connect the output of the A register to the A input of the ALU. (b) Present the ALU with control signals: M = H, S 0 = L, S 1 = L, S 2 = L, and S 3 = L. (c) Wait an appropriate dela and connect the output of the ALU (F 3 -F 0 ) to the input of the A register to reload the A register. 24 12

ALU Lab During development, ou can use a functional compile or simulation or otherwise, ou can let Quartus choose the device >This will allow ou to add etra outputs to aid in debugging If ou let Quartus choose the device, compiling will take a LONG time. So do NOT do it! But ou could pick a bigger device during development Make a table of instructions for each of the prelab requirements 25 The End! 26 13