Digital Fundamentals. Lab 6 2 s Complement / Digital Calculator

Similar documents
EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

Number Systems. Readings: , Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

Experiment 7 Arithmetic Circuits Design and Implementation

EE 109 Unit 6 Binary Arithmetic

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

Final Exam Solution Sunday, December 15, 10:05-12:05 PM

Binary Adders: Half Adders and Full Adders

INF2270 Spring Philipp Häfliger. Lecture 4: Signed Binaries and Arithmetic

Format. 10 multiple choice 8 points each. 1 short answer 20 points. Same basic principals as the midterm

Lecture 6: Signed Numbers & Arithmetic Circuits. BCD (Binary Coded Decimal) Points Addressed in this Lecture

We are quite familiar with adding two numbers in decimal

CSE140 L. Instructor: Thomas Y. P. Lee January 18,2006. CSE140L Course Info

Injntu.com Injntu.com Injntu.com R16

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

Semester Transition Point. EE 109 Unit 11 Binary Arithmetic. Binary Arithmetic ARITHMETIC

EE 109L Final Review

Binary Addition. Add the binary numbers and and show the equivalent decimal addition.

Chapter 10 Binary Arithmetics

Number System. Introduction. Decimal Numbers

Digital Logic Design Exercises. Assignment 1

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

ECE 331: N0. Professor Andrew Mason Michigan State University. Opening Remarks

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26)

EMT1250 LABORATORY EXPERIMENT. EXPERIMENT # 10: Implementing Binary Adders. Name: Date:

EE 109L Review. Name: Solutions

CO Computer Architecture and Programming Languages CAPL. Lecture 9

Real Digital Problem Set #6

Parallel logic circuits

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Basic Definition INTEGER DATA. Unsigned Binary and Binary-Coded Decimal. BCD: Binary-Coded Decimal

Chapter 3 Arithmetic for Computers

To design a 4-bit ALU To experimentally check the operation of the ALU

ELEC 326: Class project

Department of Electrical and Computer Engineering University of Wisconsin - Madison. ECE/CS 352 Digital System Fundamentals.

ELCT 501: Digital System Design

Experiment 9: Binary Arithmetic Circuits. In-Lab Procedure and Report (30 points)

1. Prove that if you have tri-state buffers and inverters, you can build any combinational logic circuit. [4]

Microcomputers. Outline. Number Systems and Digital Logic Review

Chapter 4. Combinational Logic

8/27/2016. ECE 120: Introduction to Computing. Graphical Illustration of Modular Arithmetic. Representations Must be Unambiguous

Systems Programming. Lecture 2 Review of Computer Architecture I

One and a half hours. Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

Basic Arithmetic (adding and subtracting)

R10. II B. Tech I Semester, Supplementary Examinations, May

Code No: R Set No. 1

60-265: Winter ANSWERS Exercise 4 Combinational Circuit Design

Numeric Encodings Prof. James L. Frankel Harvard University

ENEE245 Digital Circuits and Systems Lab Manual

Code No: R Set No. 1

Chapter 2 Basic Logic Circuits and VHDL Description

ENEE 245 Lab 1 Report Rubrics

UNIT IV: DATA PATH DESIGN

EXPERIMENT NUMBER 11 REGISTERED ALU DESIGN

Chapter 3: part 3 Binary Subtraction

DIGITAL ELECTRONICS. P41l 3 HOURS

VHDL Examples Mohamed Zaky

Digital Logic Design (3)

ECE 341 Midterm Exam

Student Number: UTORid: Question 0. [1 mark] Read and follow all instructions on this page, and fill in all fields.

II/IV B.Tech (Regular/Supplementary) DEGREE EXAMINATION. Answer ONE question from each unit.

EET 1131 Lab #7 Arithmetic Circuits

Digital Design with FPGAs. By Neeraj Kulkarni

Signed Binary Numbers

CS & IT Conversions. Magnitude 10,000 1,

N-input EX-NOR gate. N-output inverter. N-input NOR gate

COMP 303 Computer Architecture Lecture 6

OCR H446 A-Level Computer Science

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems

ENEE245 Digital Circuits and Systems Lab Manual

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

Representation of Non Negative Integers

Chapter 5 Design and Implementation of a Unified BCD/Binary Adder/Subtractor

COMP2611: Computer Organization. Data Representation

Arithmetic Circuits. Nurul Hazlina Adder 2. Multiplier 3. Arithmetic Logic Unit (ALU) 4. HDL for Arithmetic Circuit

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1]

REGISTER TRANSFER LANGUAGE

Principles of Digital Techniques PDT (17320) Assignment No State advantages of digital system over analog system.

HANSABA COLLEGE OF ENGINEERING & TECHNOLOGY (098) SUBJECT: DIGITAL ELECTRONICS ( ) Assignment

Review. Steps to writing (stateless) circuits: Create a logic function (one per output)

Elec 326: Digital Logic Design

VTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS Arithmetic (a) The four possible cases Carry (b) Truth table x y

CARLETON UNIVERSITY. Laboratory 2.0

Arithmetic Operations on Binary Numbers

A3 A2 A1 A0 Sum4 Sum3 Sum2 Sum1 Sum

Lab Assignment 2. Implementing Combinational and Sequential Logic in VHDL

CS 64 Week 1 Lecture 1. Kyle Dewey

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

MULTIMEDIA COLLEGE JALAN GURNEY KIRI KUALA LUMPUR

CS 151 Midterm. (Last Name) (First Name)

Experiment 18 Full Adder and Parallel Binary Adder

SIR C.R.REDDY COLLEGE OF ENGINEERING, ELURU DEPARTMENT OF INFORMATION TECHNOLOGY LESSON PLAN

Question Total Possible Test Score Total 100

IA Digital Electronics - Supervision I

Transcription:

Richland College Engineering Technology Rev. 0. Donham Rev. 1 (7/2003) J. Horne Rev. 2 (1/2008) J. radbury Digital Fundamentals CETT 1425 Lab 6 2 s Complement / Digital Calculator Name: Date: Objectives: To design and evaluate a Full Adder circuit. To perform addition and subtraction, using 2 s complement, in a digital system. Suggested Reading Chapter 6, Digital Systems, Principals and Applications; Tocci Equipment and Components Circuit Simulator (MultiSIM or an equivalent) Introduction Digital computers and systems perform various arithmetic operations, including addition and subtraction, on signed numbers represented in binary form. In order to perform a subtraction or operate on negative numbers, the digital system must have a way to represent a signed number. The most common method is to use a 2 s complement system, which includes a sign bit. The typical convention is a 1 in the most significant bit indicates a negative number and a 0 represents a positive number. The basic steps of taking the 2 s complement of a number are to invert each bit in the number and then add 1 to the inverted number. This results in the negative representation of the number. 0 0 1 0 0 binary representation of +4 1 1 0 1 1 invert each bit 0 0 0 0 1 add 1 to inverted number 1 1 1 0 0 2 s complement or binary representation of 4 The basic logic circuits used in for digital addition are a half-adder and a full-adder. The half-adder performs the addition of 2 bits and produces a sum and carry bit output. The full-adder adds 2 bits plus a carry bit. Connecting a series of full-adders can create a parallel binary adder. Page 1 of 8

Procedure: 1. The following is the truth table for a Full Adder. Write a sum-of-products expression for Sum and Cout. Simplify each expression using a K-map or oolean theorems. A Cin Sum Cout 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 Simplified Circuit Expressions Sum = Cout = Page 2 of 8

2. Using the simplified expressions, draw the schematic for a full-adder circuit. Full Adder Circuit (schematic) Page 3 of 8

3. Start MultiSIM or an equivalent circuit simulator. Load the circuit on the following page, which will be provided by your instructor or draw the schematic. This circuit is a simple digital addition/subtraction calculator. Inputs/Outputs: Registers A & are used to store the binary numbers for the arithmetic operations. Register [] = switches 3 (Sign it), 2, 1, 0 (LS) (D Flip-Flops) Register A [A] = switches 7 (Sign it), 6, 5, 4 (LS) (D Flip-Flops) Addition: Switch S set to 0V. Subtraction: Switch S set to +5V Switch C is the clear signal and clears registers A &. Normally +5, momentary 0 clears registers Circuit Operation: Set switch S to add to A (S = 0) or subtract from A (S = +5). Set switches 3, 2, 1, 0 to the binary numerical value to load into the register Set switches 7, 6, 5, 4 to the binary numerical value to load into the A register Toggle switch to cause a rising edge to clock the binary number into the register Toggle switch A to cause a rising edge to clock the binary number into the A register Output LEDs will show the result of the arithmetic operation NOTE: 2 s complement can only be performed on the -Register. The 2 s complement of the register is taken when the Subtract function is selected. Positive values should be selected with switches 3-0 () and 7-4 (A). If the subtract operation is selected, the circuit will automatically calculate and load the 2 s complement of into the adder circuits. Example: 5-3 Load 0101 into A and 0011 into. When the subtract operation is selected, the adder circuit will generate the 2 s complement of. Page 4 of 8

VCC 5V pos/neg J4 A LATCH J3 Key = A J2 Key = 7 J1 Key = 6 Key = 5 J5 J6 Key = 4 LS Key = S J13 LATCH U27 NOT MS Key = U6 REG. J11 Key = 0 J7 Key = 1 J8 Key = 2 J9 Key = 3 J10 Key = C CLR LS U1 RE U2 RE U3 RE U4 RE U14 U13 U17 U16 U20 U19 U23 U22 U15 OR2 U18 OR2 U21 OR2 U24 OR2 RE U7 RE U8 RE U9 RE U5 CARRY A SUM CIN FULL_ADDER U10 CARRY A SUM CIN FULL_ADDER U11 CARRY A SUM CIN FULL_ADDER U12 CARRY A SUM CIN FULL_ADDER Page 5 of 8

4. Use the digital calculator to perform the following arithmetic operations. Calculate the decimal value represented by the output LEDs (Show all of your work). 5. Perform the following calculation recording the results in the table. Show how the decimal value was calculated. (Show conversion steps from 5 to 0101.) 5 + 2 6. Perform the following calculation recording the results in the table. Show how the decimal value was calculated. Remember, put 6 in the register and set the sign switch for logic high. Only can be negated. 7-6 7. Perform the following calculation recording the results in the table. Show how the decimal value was calculated. Only can be negated. 5-7 Page 6 of 8

8. Perform the following calculation recording the results in the table. Show how the decimal value was calculated. Only can be negated. 4 4 9. Perform the following calculation recording the results in the table. Show how the decimal value was calculated. Only can be negated. 4-3 10. Perform the following calculation recording the results in the table. Show how the decimal value was calculated. 1-7 11. This calculator can also be used to add unsigned numbers. Assume that the A and registers as well as the result are unsigned numbers for this step. Perform the following calculation recording the results in the table. Show how the decimal value was calculated. 6 + 7 3 2 1 0 7 6 5 4 MS LS Page 7 of 8

12. Perform the following calculation recording the results in the table. Show how the decimal value was calculated. Assume that the A and registers as well as the output are unsigned numbers. 12 + 8 3 2 1 0 7 6 5 4 MS LS Did the output show the sum of 12 and 8 in binary? If NO explain why. Review Questions: Answer the following questions after the lab is completed. 1. What is the purpose of toggling switches A and after switches 3-0 and 7-4 was set? 2. What is the largest positive SIGNED number that can be represented by this calculator? 3. What is the largest UNSIGNED number that can be represented by this calculator? 4. Subtraction in a 2 s complement system actually involves adding a positive and negative number, which is in 2 s complement format. Evaluate the circuit shown on page 4 and explain how the circuit is calculating the 2 s complement of the register when the Subtract function is selected. Page 8 of 8