Answers Homework 5. Version A) The circuit is a simplified two-level circuit, plus inverters as needed for the input variables.

Similar documents
Binary Adders: Half Adders and Full Adders

Understanding Logic Design

COMBINATIONAL CIRCUITS

Let s put together a Manual Processor

DEPARTMENT OF INFORMATION TECHNLOGY

5 Combinatorial Components. 5.0 Full adder. Full subtractor

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

Sistemas Digitais I LESI - 2º ano

Gates, Circuits, and Boolean Algebra

Counters and Decoders

NEW adder cells are useful for designing larger circuits despite increase in transistor count by four per cell.

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012

Adder.PPT(10/1/2009) 5.1. Lecture 13. Adder Circuits

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

exclusive-or and Binary Adder R eouven Elbaz reouven@uwaterloo.ca Office room: DC3576

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.

ENGI 241 Experiment 5 Basic Logic Gates

Lecture 8: Binary Multiplication & Division

The string of digits in the binary number system represents the quantity

BINARY CODED DECIMAL: B.C.D.

Oct: 50 8 = 6 (r = 2) 6 8 = 0 (r = 6) Writing the remainders in reverse order we get: (50) 10 = (62) 8

EXPERIMENT 4. Parallel Adders, Subtractors, and Complementors

EE 261 Introduction to Logic Circuits. Module #2 Number Systems

Systems I: Computer Organization and Architecture

CSE140 Homework #7 - Solution

Lecture 8: Synchronous Digital Systems

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Gates & Boolean Algebra. Boolean Operators. Combinational Logic. Introduction

Lecture #21 April 2, 2004 Relays and Adder/Subtractors

ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process)

CS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on

Logic in Computer Science: Logic Gates

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

Digital Electronics Detailed Outline

Two's Complement Adder/Subtractor Lab L03

The components. E3: Digital electronics. Goals:

This Unit: Floating Point Arithmetic. CIS 371 Computer Organization and Design. Readings. Floating Point (FP) Numbers

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

CHAPTER 3 Boolean Algebra and Digital Logic

Binary full adder. 2-bit ripple-carry adder. CSE 370 Spring 2006 Introduction to Digital Design Lecture 12: Adders

(1) /30 (2) /30 (3) /40 TOTAL /100

2.0 Chapter Overview. 2.1 Boolean Algebra

Combinational Logic Design

SEQUENTIAL CIRCUITS. Block diagram. Flip Flop. S-R Flip Flop. Block Diagram. Circuit Diagram

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

Boolean Algebra Part 1

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

Lecture 5: Gate Logic Logic Optimization

Decimal Number (base 10) Binary Number (base 2)

Levent EREN A-306 Office Phone: INTRODUCTION TO DIGITAL LOGIC

CSE140: Components and Design Techniques for Digital Systems. Introduction. Prof. Tajana Simunic Rosing

Chapter 2: Boolean Algebra and Logic Gates. Boolean Algebra

Chapter 7 Memory and Programmable Logic

CSE140: Components and Design Techniques for Digital Systems

Combinational circuits

Systems I: Computer Organization and Architecture

Lecture 2. Binary and Hexadecimal Numbers

Digital circuits make up all computers and computer systems. The operation of digital circuits is based on

CSE140: Midterm 1 Solution and Rubric

6.004 Computation Structures Spring 2009

HOMEWORK # 2 SOLUTIO

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic

ASYNCHRONOUS COUNTERS

Figure 8-1 Four Possible Results of Adding Two Bits

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

Unit 3 Boolean Algebra (Continued)

CS201: Architecture and Assembly Language

Upon completion of unit 1.1, students will be able to

Today s topics. Digital Computers. More on binary. Binary Digits (Bits)

CMOS Binary Full Adder

Read-only memory Implementing logic with ROM Programmable logic devices Implementing logic with PLDs Static hazards

Gates, Plexers, Decoders, Registers, Addition and Comparison

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

Lecture-3 MEMORY: Development of Memory:

Designing Digital Circuits a modern approach. Jonathan Turner

Computer Science 281 Binary and Hexadecimal Review

Chapter 1: Digital Systems and Binary Numbers

Lecture 4: Binary. CS442: Great Insights in Computer Science Michael L. Littman, Spring I-Before-E, Continued

3.Basic Gate Combinations

CH3 Boolean Algebra (cont d)

Binary Division. Decimal Division. Hardware for Binary Division. Simple 16-bit Divider Circuit

Binary Numbering Systems

Boolean Algebra (cont d) UNIT 3 BOOLEAN ALGEBRA (CONT D) Guidelines for Multiplying Out and Factoring. Objectives. Iris Hui-Ru Jiang Spring 2010

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

List of Experiment. 8. To study and verify the BCD to Seven Segments DECODER.(IC-7447).

Two-level logic using NAND gates

DB19. 4-Bit Parallel Adder/ Subtractor. Digital Lab Experiment Board Ver. 1.0

Xilinx ISE. <Release Version: 10.1i> Tutorial. Department of Electrical and Computer Engineering State University of New York New Paltz

Lab 1: Full Adder 0.0

SECTION C [short essay] [Not to exceed 120 words, Answer any SIX questions. Each question carries FOUR marks] 6 x 4=24 marks

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 OUTCOME 3 PART 1

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Boolean Algebra. Boolean Algebra. Boolean Algebra. Boolean Algebra

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

EE360: Digital Design I Course Syllabus

Transcription:

Answers Homework 5 Task ) Design two versions (Version A and Version B below) of the combinational circuit whose input is a 4-bit number and whose output is the 2 s complement of the input number: Version A) The circuit is a simplified two-level circuit, plus inverters as needed for the input variables. We first set up the truth table for conversion to 2 s complement so that we can minimize the functions for each output with K-maps (we have 4 outputs in total). To find the 2 s complement of a binary number N, just flip the bits of N and add (you should know this from lecture ). Input 4-bit number 2 s complement of the input number A B C D S S2 S3 S4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Now we can minimize the functions S, S2, S3, and S4. Each output bit Si has its own K-map: S) AB CD C B A D

S = A B + A C + A D + AB C D S2) CD C AB B A D S2 = B C + B D + BC D S3) AB CD C B A D (notice that this is the exclusive or between C and D) S3 = C D + D C = C xor D

S4) CD C AB B A D S4 = D Now, we have all minimized functions and we can draw our circuit. A B C D S S2 S3 S4

Version B) The circuit is made up of four identical two-input, two-output cells, one for each bit. The cells are connected in cascade, with lines similar to a carry between them. The value applied to the rightmost carry bit is 0. Here s an almost identical solution that uses 4 half adders and a rightmost carry of (see the lectures). We want the rightmost carry to be 0 and to remove the inverters. So, we have to modify this circuit. Let us take the third block and make the Boolean equations for the 2 outputs Si, Ci+. Ai Ai- HA HA HA HA Ci+ Bi Ci Bi- Si Si- We can show that Si is Ai xor Bi. This makes our work a lot easier. Si = Ai xor Bi = Ai Bi + AiBi = (See Lecture 5 for half adders) = Ai Bi + Ai Bi = Ai xor Bi If we want to use Bi then we have to use (Ci) from the previous block and to generate (Ci+) for the next block Ci+ = Ai Bi (Ci+) = (Ai Bi) = Ai + Bi Now we have the needed Boolean equations to make our circuit. Since, we complemented Bi we can use 0 instead of in the right most carry (all blocks are identical).

Ai (Ci+) Bi 0 Si Below, we draw the circuit that is inside of one of the blocks (all blocks are identical). The only difference with a half adder is the OR gate (a half adder uses an AND gate) Ai (Ci+) Bi Si

Task 2) Design a 5-bit signed magnitude adder-subtractor ( bit for the sign and 4 bits for the magnitude). Divide the circuit for design into: () sign generation and add/subtract control logic, (2) an unsigned number addersubtractor using 2 s complement of the subtrahend for subtraction, and (3) selective 2 s complement result correction logic. Here is the circuit divided in three parts. () add/subtract control logic, (2) an unsigned adder-subtractor and (3) a selective 2 s complement result correction logic. Let us examine the individual parts more closely. A3 A2 A A0 B3 B2 B B0 S Sign Cout OP C4 Sub/Add 4 bit add/ subtract 2 S3 S2 S S0 Selective 2's Complementer Correct 3 R4 R3 R2 R R0

Circuit ) S is the operation we want to do (S = is subtraction, S = 0 is addition). and are the sign bits of the signed numbers. Cout is the carry out from circuit (2). OP is the signal that determines the real operation (add or subtract) depending on the signs and as well as from the input S. After we have checked the signs and carry we can determine the final sign (R4) for the addition/subtraction. Let us set up a truth table for this purpose. The outputs are OP and Sign, the rest is all input. S Cout OP Sign meaning 0 0 0 0 0 0 (+A) + (+B), +(A+B) 0 0 0 0 0 overflow 0 0 0 (+A) (+B), B>A, -(A-B) 0 0 0 (+A) (+B), A>B, +(A-B) 0 0 0 (+A) + (-B), B>A, -(A-B) 0 0 0 (+A) + (-B), A>B, +(A-B) 0 0 0 0 (+A) - (-B), B>A, +(A+B) 0 0 0 (+A) - (-B), B>A, +(A+B) 0 0 0 0 (-A) + (+B), B>A, +(A-B) 0 0 (-A) + (+B), A>B, -(A-B) 0 0 0.. you get the point 0 0.. you get the point 0 0 0.. you get the point 0 0.. you get the point 0 0.. you get the point.. you get the point K-Map for OP OP S Cout OP = S + S + A S + S = xor xor S

K-Map for Sign S Sign Cout Sign = Cout + S Cout + S Cout = Cout + Cout ( xor S) Now we can draw the circuit. OP S Cout Sign

Circuit 2) See Lecture 5 for the circuit of unsigned 2 s complement Adder- Subtractor. Circuit 3) Selective 2 s complementer. We only want to take the 2 s complement when needed. (See the truth table for () if you want to know why) so we use the correct line which is if the carry is zero and a subtract operation is used. If correct is it complements and adds to the input, else it does nothing and the output equals the input. S3 S2 S S0 Correct HA HA HA HA R3 R2 R R0