Week 7: Assignment Solutions

Similar documents
CS/COE 0447 Example Problems for Exam 2 Spring 2011

Computer Architecture Set Four. Arithmetic

Tailoring the 32-Bit ALU to MIPS

ECE 30 Introduction to Computer Engineering

More complicated than addition. Let's look at 3 versions based on grade school algorithm (multiplicand) More time and more area

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

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

Chapter 3 Arithmetic for Computers

ECE 341 Midterm Exam

COMPUTER ARITHMETIC (Part 1)

COMP 303 Computer Architecture Lecture 6

CS 5803 Introduction to High Performance Computer Architecture: Arithmetic Logic Unit. A.R. Hurson 323 CS Building, Missouri S&T

Timing for Ripple Carry Adder

PESIT Bangalore South Campus

At the ith stage: Input: ci is the carry-in Output: si is the sum ci+1 carry-out to (i+1)st state

Chapter 3 Arithmetic for Computers. ELEC 5200/ From P-H slides

By, Ajinkya Karande Adarsh Yoga

9/6/2011. Multiplication. Binary Multipliers The key trick of multiplication is memorizing a digit-to-digit table Everything else was just adding

Homework 3. Assigned on 02/15 Due time: midnight on 02/21 (1 WEEK only!) B.2 B.11 B.14 (hint: use multiplexors) CSCI 402: Computer Architectures

Lecture 8: Addition, Multiplication & Division

Chapter 5 : Computer Arithmetic

Computer Architecture and Organization

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

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: The MIPS ISA (P&H ) Consulting hours. Milestone #1 (due 1/26)

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 3 DLD P VIDYA SAGAR

Principles of Computer Architecture. Chapter 3: Arithmetic

Chapter 5: Computer Arithmetic. In this chapter you will learn about:

DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS

carry in carry 1101 carry carry

We are quite familiar with adding two numbers in decimal

Integer Multiplication and Division

Learning Objectives. Binary over Decimal. In this chapter you will learn about:

Binary Adders. Ripple-Carry Adder

EC2303-COMPUTER ARCHITECTURE AND ORGANIZATION

Arithmetic and Logical Operations

Fast Arithmetic. Philipp Koehn. 19 October 2016

ECE 341 Midterm Exam

Number Systems and Computer Arithmetic

Chapter 3: part 3 Binary Subtraction

CPE300: Digital System Architecture and Design

Combinational Circuits

Basic Arithmetic (adding and subtracting)

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

IMPLEMENTATION OF TWIN PRECISION TECHNIQUE FOR MULTIPLICATION

Arithmetic Logic Unit. Digital Computer Design

VLSI for Multi-Technology Systems (Spring 2003)

NUMBER OPERATIONS. Mahdi Nazm Bojnordi. CS/ECE 3810: Computer Organization. Assistant Professor School of Computing University of Utah

Chapter 5: Computer Arithmetic

BINARY SYSTEM. Binary system is used in digital systems because it is:

COMPUTER ORGANIZATION AND ARCHITECTURE

Arithmetic Logic Unit

1. Mark the correct statement(s)

CS/COE 0447 Example Problems for Exam 2 Fall 2010

COMPUTER ARCHITECTURE AND ORGANIZATION. Operation Add Magnitudes Subtract Magnitudes (+A) + ( B) + (A B) (B A) + (A B)

Computer Organisation CS303

ECE260: Fundamentals of Computer Engineering

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 3. Arithmetic for Computers Implementation

Chapter 3 Arithmetic for Computers (Part 2)

EE878 Special Topics in VLSI. Computer Arithmetic for Digital Signal Processing

Binary Adders: Half Adders and Full Adders

EEC 483 Computer Organization

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

EE260: Logic Design, Spring n Integer multiplication. n Booth s algorithm. n Integer division. n Restoring, non-restoring


Chapter 3: Arithmetic for Computers

CPS 104 Computer Organization and Programming

CS Computer Architecture. 1. Explain Carry Look Ahead adders in detail

Outline. EEL-4713 Computer Architecture Multipliers and shifters. Deriving requirements of ALU. MIPS arithmetic instructions

Chapter 3. ALU Design

CS 64 Week 1 Lecture 1. Kyle Dewey

Math in MIPS. Subtracting a binary number from another binary number also bears an uncanny resemblance to the way it s done in decimal.

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

EECS150 - Digital Design Lecture 13 - Combinational Logic & Arithmetic Circuits Part 3

Arithmetic Operations

ECE468 Computer Organization & Architecture. The Design Process & ALU Design

Chapter 4. Combinational Logic

The ALU consists of combinational logic. Processes all data in the CPU. ALL von Neuman machines have an ALU loop.

SUBROUTINE NESTING AND THE PROCESSOR STACK:-

Chapter 10 - Computer Arithmetic

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

Lecture 19: Arithmetic Modules 14-1

EE878 Special Topics in VLSI. Computer Arithmetic for Digital Signal Processing

EE292: Fundamentals of ECE

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Digital Logic. Copyright By NODIA & COMPANY

60-265: Winter ANSWERS Exercise 4 Combinational Circuit Design

Learning Outcomes. Spiral 2 2. Digital System Design DATAPATH COMPONENTS

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

CPE 335 Computer Organization. MIPS Arithmetic Part I. Content from Chapter 3 and Appendix B

EE 8351 Digital Logic Circuits Ms.J.Jayaudhaya, ASP/EEE

UNIT-III COMPUTER ARTHIMETIC

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

Computer Organization EE 3755 Midterm Examination

Topics. 6.1 Number Systems and Radix Conversion 6.2 Fixed-Point Arithmetic 6.3 Seminumeric Aspects of ALU Design 6.4 Floating-Point Arithmetic

Design of Arithmetic Units ECE152B AU 1

University of Illinois at Chicago. Lecture Notes # 10

MIPS Integer ALU Requirements

ECE331: Hardware Organization and Design

9 Multiplication and Division

Integer Arithmetic. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Transcription:

Week 7: Assignment Solutions 1. In 6-bit 2 s complement representation, when we subtract the decimal number +6 from +3, the result (in binary) will be: a. 111101 b. 000011 c. 100011 d. 111110 Correct answer is (a). Subtracting +6 from +3 is the same as adding the 2 s complement of 6 to 3. +3: 000011-6 (in 2 s complement): 111010 -------------- 111101 2. For a straightforward two-level implementation (with NOT gates required to invert input variables) of a full adder using AND, OR and NOT gates only, the number of gates required will be.. Correct answer is 12. The carry function AB + BC + CA would require 3 AND gates and 1 OR gate. The sum function A B C + A BC + AB C + ABC will require 3 NOT gates for complementing the variables, 4 AND gates to generate the product terms, and 1 OR gate to combine them. The total number of gates is 3 + 1 + 3 + 4 + 1 = 12. 3. Suppose that the carry output of a full adder is implemented in two-level gate realization using NAND gates only. Assume that the propagation delay of a 2-input gate is 1 nsec, and that of a 3-input gate is 1.5 nsec. The total propagation delay to generate the carry will be nsec. Correct answer is 2.5. Two-level AND-OR is equivalent to two-level NAND-NAND. In first level we shall have three 2-input NAND gates in parallel, and in the second level there will be one 3-input NAND gate. Total delay will be 1 nsec + 1.5 nsec = 2.5 nsec 4. Assume that for a full adder implementation, the delay for sum and carry generation are 6 nsec and 4 nsec respectively. The worst-case delay of a 16-bit ripple carry adder will be: a. 96 nsec b. 64 nsec c. 66 nsec

d. None of the above Correct answer is (c). The carry will ripple through the 16 stages, and so the carry propagation time = 16 x 4 = 64 nsec. In the last adder, generation of sum will require 2 nsec more that generation of carry. So the worst-case delay will be 64 + 4 = 66 nsec. 5. For a full adder stage FAi in a carry look-ahead adder, which of the following statements are false? a. The carry generate function Gi will be 1 if both the inputs Ai and Bi are 1. b. The carry propagate function Pi will be 1 if at least one of the inputs Ai and Bi are 1. c. The carry generate function Gi will be 1 if exactly one of the inputs Ai and Bi are 1. Correct answers are (b) and (c). The carry generate function is defined as Gi = Ai.Bi The carry propagate function is defined as Pi = Ai xor Bi The answer follows from the function definitions. 6. Suppose we are using 4-bit carry lookahead adder modules to build a 64- bit adder with two-level carry lookahead, with ripple carry between the modules. If the delay of a basic gate (AND, OR, NOT) is 2 nanoseconds, the worst-case delay of the 64-bit adder will be.. nanoseconds. Correct answer is 24. Basic gate delay δ = 2 nsec Delay of the 2-level 64-bit carry lookahead adder will be TCLA = (6 + 2 ceiling{log4 64} ) δ = 12 δ = 12 x 2nsec = 24 nsec

7. Suppose that we are adding 15 32-bit numbers using 32-bit carry save adder modules and a parallel adder in the last stage of the computation. The minimum number of carry save adders required will be: a. 15 b. 18 c. 16 d. 13 Correct answer is (d). Each carry save adder can be used to add a maximum of 3 numbers, and generates 2 numbers as output (a sum word and a carry word). 8. When two 8-bit numbers (A7 A6 A0) and (B7 B6 B0) in 2 s complement representation (with A0 and B0 as the least significant bits) are added using ripple carry adder, the sum bits obtained are (S7 S6 S0) and the carry bits are (C7 C6 C0). An overflow is said to have occurred if: a. The carry bit C7 is 1 b. All the carry bits (C7 C6 C0) are 1 c. A7.B7.S7 + A7.B7.S7 is 1 d. A0.B0.S0 + A0.B0.S0 is 1 Correct answer is (c). Overflow occurs only when both the numbers are positive or both the numbers are negative, and the sign of the sum gets reversed. Condition (c) states this situation. 9. Why does the MIPS32 architecture does not have any status flags? a. It helps in efficient pipeline implementation. b. A dedicated register is used to store the status flags. c. The status flags are embedded in the instruction encoding.

Correct answer is (a). In a pipeline implementation, there are several instructions that are in various stages of execution. If there were flag register, we would require one such register for every instruction that is executing in some stage of the pipeline. Moreover, for branch and exception processing, situation becomes more complicated. Hence for ease of pipeline implementation, RISC architectures like MIPS32 do not have any status flags. 10. Which of the following are true for n-bit unsigned multiplication? a. The product is (n+1) bits long b. The product is 2n bits long c. The number of partial products is 2n d. The number of partial products is n 2 Correct answers are (b) and (d). The number of bits of the product can be double the number of bits of the number being multiplied (e.g. in 3 bits, 111 x 111 = 110001). Every bit of the multiplier will generate a partial product with every bit of multiplicand; the total number will be square of the number of bits. 11. For the binary number 1100110111, the Booth encoding will be: a. 0-1 0 +1 0-1 0 0-1 b. 0-1 0 +1 0-1 0 0 0 c. +1 0-1 0 +1 0-1 0 0 d. None of the above Correct answer is (a). We take bits pairs (overlapping) from left to right and encode them as follows: 00 or 11 are encoded as 0, 10 is encoded as -1, and 01 is encoded as +1. 12. Which of the following statements are true? a. Booth s multiplier is faster than shift-and-add multiplier. b. Booth s multiplier with bit-pair recoding is faster than conventional Booth s multiplier. c. Carry-save multiplier is faster than Booth s multiplier. d. Carry-save multiplier is slower than Booth s multiplier. Correct answers are (a), (b) and (c). (a) is true since Booth s multiplier do not need addition for bit pairs 00 or 11 in the multiplier. (b) is true since bit-pair recoding is guaranteed to reduce the number of operations required. (c) is true as carry save multiplication is a combinational multiplier, which is much faster that Booth s multiplier that is based on sequential shift and add. 13. Which of the following is not true for restoring division algorithm?

a. A trial subtraction is carried out in each iteration, followed by a corrective addition if required. b. A trial addition is carried out in each iteration, followed by a corrective subtraction if required. c. The next quotient bit is set to 1 if the partial result is negative. Correct answer is (b). The answer follows from the basic algorithm of restoring division. 14. Which of the following statements are true? a. Non-restoring division is faster than restoring division. b. The correction step that is required in restoring division is eliminated in non-restoring division. c. For n-bit divisor and n-bot dividend, the number of restoring additions will be n/2 on the average. d. The data paths required for shift-and-add multiplication and restoring division are somewhat similar. All the four answers are correct. The answers directly follow from the restoring and non-restoring division algorithms.