Experiment # 4. Binary Addition & Subtraction. Eng. Waleed Y. Mousa

Similar documents
Experiment # 3 Combinational Circuits (I) Binary Addition and Subtraction

COMBINATIONAL LOGIC CIRCUIT First Class. Dr. AMMAR ABDUL-HAMED KHADER

Combinational Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

COMBINATIONAL CIRCUIT

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

4:Combinational logic circuits. 3 July

Binary Adder and Subtractor circuit

UNIT III. Designing Combinatorial Circuits. Adders

Module 4: Design and Analysis of Combinational Circuits 1. Module-4. Design and Analysis of Combinational Circuits

LOGIC GATES AND LOGIC CIRCUITS A logic gate is an elementary building block of a Digital Circuit. Most logic gates have two inputs and one output.

UNIT-IV Combinational Logic

;UsetJand : Llto Record the truth. LAB EXERCISE 6.1 Binary Adders. Materials. Procedure

EXPERIMENT NO 1 TRUTH TABLE (1)

TABLE 3-2 Truth Table for Code Converter Example

Department of Electronics and Communication Engineering

CHAPTER 5 DESIGN OF COMBINATIONAL LOGIC CIRCUITS IN QCA

Dr. Nicola Nicolici COE/EE2DI4 Midterm Test #1 Oct 18, 2006

Combinational Circuits DC-IV (Part I) Notes

Subtractor Logic Schematic

SRV ENGINEERING COLLEGE SEMBODAI RUKMANI VARATHARAJAN ENGINEERING COLLEGE SEMBODAI

LOGIC DIAGRAM: HALF ADDER TRUTH TABLE: A B CARRY SUM. 2012/ODD/III/ECE/DE/LM Page No. 1

UNIT-2: BOOLEAN EXPRESSIONS AND COMBINATIONAL LOGIC CIRCUITS

DESIGN OF 4 BIT BINARY ARITHMETIC CIRCUIT USING 1 S COMPLEMENT METHOD

Combinational Logic Circuits. Combinational Logic

Linear & Digital IC Applications (BRIDGE COURSE)

MSI Design Examples. Designing a circuit that adds three 4-bit numbers

Unit 3. Logic Design

LIST OF EXPERIMENTS. KCTCET/ /Odd/3rd/ETE/CSE/LM

DELD MODEL ANSWER DEC 2018

(CSC-3501) Lecture 6 (31 Jan 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

Logic Circuit Design

Topic Notes: Digital Logic

BCD Adder. Lecture 21 1

Structural VHDL Implementation of Wallace Multiplier

Digital Electronics. Functions of Combinational Logic

Adder (electronics) - Wikipedia, the free encyclopedia

Asst. Prof. Thavatchai Tayjasanant, PhD. Power System Research Lab 12 th Floor, Building 4 Tel: (02)

DESIGN OF MODIFIED AND UNERRING FOUR BIT BINARY SIGNED SUBTRACTOR

Lab Report: Digital Logic

Number system: the system used to count discrete units is called number. Decimal system: the number system that contains 10 distinguished

Digital System Design

Laboratory Manual CS (P) Digital Systems Lab

Building Blocks for Digital Design

Spec. Instructor: Center

Function Table of an Odd-Parity Generator Circuit

Sr. No. Instrument Specifications. TTL (Transistor-Transistor Logic) based on bipolar junction transistors


Digital Integrated CircuitDesign

COMPUTER ARCHITECTURE AND ORGANIZATION

COLLEGE OF ENGINEERING, NASIK

Digital Logic and Design (Course Code: EE222) Lecture 14: Combinational Contd.. Decoders/Encoders

Datapath Components. Control vs. Datapath, Registers, Adders (Binary Addition) Copyright (c) 2012 Sean Key

Multiplier and Accumulator Using Csla

FUNCTION OF COMBINATIONAL LOGIC CIRCUIT

Binary Addition. Boolean Algebra & Logic Gates. Recap from Monday. CSC 103 September 12, Binary numbers ( 1.1.1) How Computers Work

CSE 370 Winter Homework 5 Solutions

Digital. Design. R. Ananda Natarajan B C D

CHW 261: Logic Design

FPGA IMPLENTATION OF REVERSIBLE FLOATING POINT MULTIPLIER USING CSA

SIMULATION DESIGN TOOL LABORATORY MANUAL

DIGITAL ELECTRONICS QUESTION BANK

CPE 100L LOGIC DESIGN I

2 Building Blocks. There is often the need to compare two binary values.

Comparative Analysis of Various Adders using VHDL

A Highly Efficient Carry Select Adder

Approximate Hybrid Equivalent Circuits. Again, the impedance looking into the output terminals is infinite so that. conductance is zero.

Lesson: Binary Arithmetic and Arithmetic Circuits-2. Lesson Developer: Dr. Divya Haridas

0 A. Review. Lecture #16. Pipeline big-delay CL for faster clock Finite State Machines extremely useful You!ll see them again in 150, 152 & 164

Signal Processing Using Digital Technology

DELD UNIT 3. Question Option A Option B Option C Option D Correct Option A B C

ISSN Vol.03, Issue.07, September-2015, Pages:

EEE 301 Digital Electronics

Combinational Circuit Design using Advanced Quantum Dot Cellular Automata

UNIVERSITY OF MASSACHUSETTS Dept. of Electrical & Computer Engineering. Digital Computer Arithmetic ECE 666

Design and Simulation of 32-Bit Carry-Ripple Adder using HSPICE and Mentor Graphics

Enhancement of Design Quality for an 8-bit ALU

CHAPTER 3 ANALYSIS OF LOW POWER, AREA EFFICIENT AND HIGH SPEED ADDER TOPOLOGIES

Exercise 2: OR/NOR Logic Functions

DIGITAL LOGIC COMPUTER SCIENCE

DESIGN AND IMPLEMENTATION OF AREA EFFICIENT, LOW-POWER AND HIGH SPEED 128-BIT REGULAR SQUARE ROOT CARRY SELECT ADDER

Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates

FULL ADDER USING MULTIPLEXER

COMPUTER ORGANIZATION & ARCHITECTURE DIGITAL LOGIC CSCD211- DEPARTMENT OF COMPUTER SCIENCE, UNIVERSITY OF GHANA

WEEK 4.1. ECE124 Digital Circuits and Systems Page 1

CHAPTER 1 INTRODUCTION

Investigation on Performance of high speed CMOS Full adder Circuits

Circuits in CMOS VLSI. Darshana Sankhe

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) MODEL ANSWER

Satish Chandra, Assistant Professor, P P N College, Kanpur 1

Practical Workbook Logic Design & Switching Theory

International Journal of Scientific & Engineering Research, Volume 5, Issue 5, May-2014 ISSN

EXPERIMENT 12: DIGITAL LOGIC CIRCUITS

Computer Architecture and Organization:

Gates and Circuits 1

High Speed Non-Linear Carry Select Adder

IES Digital Mock Test

FPGA Implementation of Area Efficient and Delay Optimized 32-Bit SQRT CSLA with First Addition Logic

CS 61C: Great Ideas in Computer Architecture Finite State Machines, Functional Units

EE292: Fundamentals of ECE

Solutions. ICS 151 Final. Q1 Q2 Q3 Q4 Total Credit Score. Instructions: Student ID. (Last Name) (First Name) Signature

Transcription:

Experiment # 4 Binary Addition & Subtraction Eng. Waleed Y. Mousa

1. Objectives: 1. To study adder and subtractor circuits using logic gates. 2. To construct and test various adders and subtractor circuits. 2. Theory: Adders: Adder circuit is a combinational digital circuit that is used for adding two numbers. A typical adder circuit produces a sum bit (denoted by S) and a carry bit (denoted by C) as the output. Typically adders are realized for adding binary numbers but they can be also realized for adding other formats like BCD (binary coded decimal), XS-3 etc. Besides addition, adder circuits can be used for a lot of other applications in digital electronics like address decoding, table index calculation etc. Adder circuits are of two types: Half adder ad Full adder. 1. Half Adder: Half adder is a combinational arithmetic circuit that adds two numbers and produces a sum bit (S) and carry bit (C) as the output. If A and B are the input bits, then sum bit (S) is the X-OR of A and B and the carry bit (C) will be the AND of A and B. From this it is clear that a half adder circuit can be easily constructed using one X- OR gate and one AND gate. Half adder is the simplest of all adder circuit, but it has a major disadvantage, the half adder can add only two input bits (A and B) and has nothing to do with the carry if there is any in the input, So if the input to a half adder have a carry, then it will be neglected it and adds only the A and B bits. That means the binary addition process is not complete and that s why it is called a half adder. The truth table, schematic representation and XOR//AND realization of a half adder are shown in the figure below. S = AB'+A'B = AB C = A.B 1

2. Full Adder: Full adder is a logic circuit that adds two input operand bits plus a Carry in bit and outputs a Carry out bit and a sum bit. The Sum out (Sout) of a full adder is the XOR of input operand bits A, B and the Carry in (Cin) bit. Truth table and schematic of a 1 bit Full adder is shown below A Full adder can be made by combining two half adder circuits together (a half adder is a circuit that adds two input bits and outputs a sum bit and a carry bit). S = A'B'Cin + A'BCin' + AB'Cin' + ABCin = A B Cin Cout = ABCin' + AB'Cin+ A'BCin+ ABCin= (A B).Cin + A.B 2

Subtractors: The subtraction of two binary numbers may be accomplished by taking the complement of the subtrahend and adding it to the minuend. By this method, the subtraction operation becomes an addition operation requiring full adders for its machine implementation. It is possible to implement subtraction with logic circuits in a direct manner. By this method, each subtrahend bit of the number is subtracted from its corresponding significant minuend bit to form a different bit. If the minuend bit is smaller than the subtrahend bit, a 1 is borrowed from the next significant position. The fact that a 1 has been borrowed must be conveyed to the next higher pair of bits by means of a binary signal coming out (output) of a given stage and going into (input) the next higher stage. 1. Half Subtractor: The half-subtractor is a combinational circuit which is used to perform subtraction of two bits. It has two inputs, X (minuend) and Y (subtrahend) and two outputs D (difference) and B (borrow). Suppose the minuend bit is x and the subtrahend bit is y. If we want to perform x-y, we have to check the relative magnitude between x and y. If x>=y, we have three possibilities: 0-0=0, 1-0=1 and 1-1=0. The result is known as difference bit. If x<y we have 0-1, and it's necessary to borrow 1 from the next higher stage. The borrowed 1 adds 2 to the minuend bit. With the minuend equal to 2, the difference becomes 2-1=1. The half-subtractor needs two outputs. One is needed to generate the difference and is denoted by the symbol D and the other is needed to show the borrowed bit and is denoted by the symbol B. 3

2. Full Subtractor: The full-subtractor is a combinational circuit which is used to perform subtraction of three bits. It has three inputs, X (minuend) and Y (subtrahend) and Z (subtrahend) and two outputs D (difference) and B (borrow). D=X-Y-Z B = 1 If X<(Y+Z) Inputs Outputs X Y Z D B 0 0 0 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1 0 1 1 0 0 1 0 1 0 1 0 0 1 1 0 0 0 1 1 1 1 1 D = X Y Z. B = X'Y'Z + X'YZ' + X'YZ + XYZ = Z.( X Y)' + X'.Y B = X'Y + X'Z + YZ 4

Parallel Addition: Multiple full adder circuits can be cascaded in parallel to add an N-bit number. For an N- bit parallel adder, there must be N numbers of full adder circuits. A ripple carry adder is a logic circuit in which the carry-out of each full adder is the carry in of the succeeding next most significant full adder. It is called a ripple carry adder because each carry bit gets rippled into the next stage. In a ripple carry adder the sum and carry out bits of any half adder stage is not valid until the carry in of that stage occurs. Note that the first (and only the first) full adder may be replaced by a half adder. Adder-Subtractor: In digital circuits, an adder subtractor is a circuit that is capable of adding or subtracting numbers (in particular, binary). Below is a circuit that does adding or subtracting depending on a control signal. It is also possible to construct a circuit that performs both addition and subtraction at the same time. 5

sel: controller, adding when sel=0 and Subtracting when sel=1. Adding: A+B. Sub: A-B. V: overflow flag, denote that an overflow happened when V=1. 3. Lab Work: Part 1: Construct the circuit of HA using module KL-33004 block a, connect inputs A and B to data switches and outputs F1 (carry) and F2 (sum) to LEDs then find the truth table. Part2: Construct the circuit of FA using module KL-33004 block a, connect inputs A, B and C to data switches and outputs F3 (carry) and F5 (sum) to LEDs then find the truth table. Part3: Construct the circuit of HS and FS using module KL-33004 block a 4. Exercises: 1) Implement the 4-bit Borrow Ripple Subtractor using Full Subtractor. 2) Implement the 4-bit Borrow Ripple Subtractor using Full Adder. 3) Using four half-adders design a four bit combinational circuit incrementer (a circuit that adds 1 to a four bit binary number). 6