Solutions - Homework 2 (Due date: February 5 5:30 pm) Presentation and clarity are very important! Show your procedure!

Similar documents
Solutions - Homework 2 (Due date: October 4 5:30 pm) Presentation and clarity are very important! Show your procedure!

DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING, THE UNIVERSITY OF NEW MEXICO ECE-238L: Computer Logic Design Fall 2013.

Solutions - Homework 2 (Due date: October 9:30 am) Presentation and clarity are very important!

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-278: Digital Logic Design Fall Notes - Unit 4. hundreds.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-2700: Digital Logic Design Winter Notes - Unit 4. hundreds.

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

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

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

Chapter 4. Combinational Logic

Optional: Building a processor from scratch

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

Lecture 10: Combinational Circuits

Chapter 10 Binary Arithmetics

Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm. Nathan Pihlstrom.

Advanced Computer Architecture-CS501

Lecture 2: Number Systems

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


Number System. Introduction. Decimal Numbers

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

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

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

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems

EE 109L Review. Name: Solutions

EE292: Fundamentals of ECE

24 Nov Boolean Operations. Boolean Algebra. Boolean Functions and Expressions. Boolean Functions and Expressions

CHW 261: Logic Design


Arithmetic Logic Unit (ALU)

Chapter Three. Digital Components

Introduction to Computer Science. Homework 1

R a) Simplify the logic functions from binary to seven segment display code converter (8M) b) Simplify the following using Tabular method

Binary Codes. Dr. Mudathir A. Fagiri

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

COMBINATIONAL LOGIC CIRCUITS

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 4

World Inside a Computer is Binary

Wednesday, February 19, 2014

6: Combinational Circuits

PART A (22 Marks) 2. a) Briefly write about r's complement and (r-1)'s complement. [8] b) Explain any two ways of adding decimal numbers.

SE311: Design of Digital Systems

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

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

Combinational Circuits

Real Digital Problem Set #6

Chapter 1. Digital Systems and Binary Numbers

VON NEUMANN ARCHITECTURE. VON NEUMANN ARCHITECTURE IB DP Computer science Standard Level ICS3U

Chapter 2 Number System

Chap.3 3. Chap reduces the complexity required to represent the schematic diagram of a circuit Library

Revision: August 31, E Main Suite D Pullman, WA (509) Voice and Fax

Binary Adders: Half Adders and Full Adders

Korea University of Technology and Education

Number Systems. Both numbers are positive

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

Course overview. Computer Organization and Assembly Languages Yung-Yu Chuang 2006/09/18. with slides by Kip Irvine

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

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

Arithmetic Logic Unit

Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates. Invitation to Computer Science, C++ Version, Third Edition

Combinational Circuit Design

Number Systems Base r

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

Topics. FPGA Design EECE 277. Number Representation and Adders. Class Exercise. Laboratory Assignment #2

CS/EE1012 INTRODUCTION TO COMPUTER ENGINEERING SPRING 2013 HOMEWORK I. Solve all homework and exam problems as shown in class and sample solutions

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

COMPUTER ORGANIZATION AND ARCHITECTURE

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

ECE2049: Homework 1. Consider the following code to compute the average of your exam grades: #define NUM_EXAMS (3)

END-TERM EXAMINATION

Chapter 3: part 3 Binary Subtraction

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

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

ECE 341 Midterm Exam

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

SIDDHARTH GROUP OF INSTITUTIONS :: PUTTUR Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE)

Part 2,Number Systems Questions

Scheme G. Sample Test Paper-I

EE 109L Final Review

Hybrid Electronics Laboratory

CO Computer Architecture and Programming Languages CAPL. Lecture 9

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

Information Science 1

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

Binary Arithmetic. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T.

Principles of Computer Architecture. Chapter 3: Arithmetic

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

Register Transfer Language and Microoperations (Part 2)

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY COMPUTER ARCHITECURE- III YEAR EEE-6 TH SEMESTER 16 MARKS QUESTION BANK UNIT-1

CS & IT Conversions. Magnitude 10,000 1,

EE 109 Unit 6 Binary Arithmetic

Internal architecture of 8086

Combinational Logic. Prof. Wangrok Oh. Dept. of Information Communications Eng. Chungnam National University. Prof. Wangrok Oh(CNU) 1 / 93

THE LOGIC OF COMPOUND STATEMENTS

Arab Open University. Computer Organization and Architecture - T103

Microcomputers. Outline. Number Systems and Digital Logic Review

Intel 8086 MICROPROCESSOR. By Y V S Murthy

D I G I T A L C I R C U I T S E E

Transcription:

Solutions - Homework (Due date: Februar 5 th @ 5: pm) Presentation and clarit are ver important! Show our procedure! PROBLEM ( PTS) In these problems, ou MUST show our conversion procedure. a) Convert the following decimal numbers to their s complement representations: binar and headecimal. (6 pts) -9.5, 7.6565, -8.5785, -.5. - 9.5 =. -9.5 =. = E76.B - 7.6565 =. = 5.A8-8.5785 =. -8.5785 =. = F7F.7E -.5 =. -.5 =. = E.C b) Complete the following table. The decimal numbers are unsigned: (8 pts.) Decimal BCD Binar Reflective Gra Code 97 64 85 56 4 4 95 c) Complete the following table. Use the fewest number of bits in each case: (6 pts.) REPRESENTATION Decimal Sign-and-magnitude 's complement 's complement - -56-77 -5-65 7 PROBLEM (5 PTS) a) What is the minimum number of bits required to represent: ( pts), smbols? Numbers between 5, and 4,9? log = 7 log (49 5 + ) = log 89 = 4 b) A microprocessor has a -bit address line. The sie of the memor contents of each address is 8 bits. The memor space is defined as the collection of memor positions the processor can address. (5 pts) - What is the address range (lowest to highest, in headecimal) of the memor space for this microprocessor? What is the sie (in btes, KB, or MB) of the memor space? KB = btes, MB = btes, GB = btes Address range: to FFFFFFFF. With bits, we can address btes, thus we have = 4 GB of address space - A memor device is connected to the microprocessor. Based on the sie of the memor, the microprocessor has assigned the addresses BC to BFFFFFF to this memor device. What is the sie (in btes, KB, or MB) of this memor device? What is the minimum number of bits required to represent the addresses onl for this memor device? As per the figure below, we onl need bits for the addresses in the given range. Thus, the sie of the memor device is = 4MB. Address : BC : BC : BFFFFFF 8 bits Instructor: Daniel Llamocca

b 8 = b 7 = b 6 = b 5 = b 4 = b = b = b = c 9 = c 8 = c 4 = b 8 = b 7 = b 6 = b 5 = b 4 = b = b = b = c 6 = c 5 = b 8 = b 7 = b 6 = b 5 = b 4 = b = b = b = c) The figure below depicts the entire memor space of a microprocessor. Each memor address occupies one bte. (8 pts) - What is the sie (in btes, KB, or MB) of the memor space? What is the address bus sie of the microprocessor? Address sie: to FFFFFF. To represent all these addresses, we require 4 bits. So, the address bus sie of the microprocessor is 4 bits. The sie of the memor space is then 4 = 6 MB. - If we have a memor chip of MB, how man bits do we require to address MB of memor? MB memor device: MB = = btes. Thus, we require bits to address the memor device. - We want to connect the MB memor chip to the microprocessor. Provide an address range so that MB of memor is properl addressed. You can onl use the non-occupied portions of the memor space as shown in the figure below. MB of memor require bits. The -bit address range would be from to FFFFF. Within the entire 4- bit memor space, there are four options to place those MB in the figure. In particular, we picked the address range from 4 to 5FFFFF. FFFFFF C 7FFFFF 5FFFFF 6 4 FFFFF 8 bits PROBLEM ( PTS) a) Perform the following additions and subtractions of the following unsigned integers. Use the fewest number of bits n to represent both operators. Indicate ever carr (or borrow) from c to c n (or b to b n). For the addition, determine whether there is an overflow. For the subtraction, determine whether we need to keep borrowing from a higher bte. (8 pts) Eample (n=8): 54 + 77-94 Borrow out! 54 = 6 = + = D = 77 = 4D = - 94 = C = 7 + 7 4 97 + 75 8 4 7 = F = + 7 = 89 = 48 = 98 = Borrow out! 4 = B = - 97 = 6 = CA = = 6F = + 75 = 4B = No Borrow Out 8 = 8 = - 4 = B = 85 = 55 = Instructor: Daniel Llamocca

c = c= c8= c 6 = c5= c4= c = c= c5= c= c = c6= c 5 = c 4 = c= c = c6= c4= c= c8= c5= c= c= c6= c= c= b) We need to perform the following operations, where numbers are represented in 's complement: (6 pts) -97 + 56 99-6 4 + 67-7 - 7 For each case: Determine the minimum number of bits required to represent both summands. You might need to sign-etend one of the summands, since for proper summation, both summands must have the same number of bits. Perform the binar addition in s complement arithmetic. The result must have the same number of bits as the summands. Determine whether there is overflow b: i. Using c n, c n (carries). ii. Performing the operation in the decimal sstem and checking whether the result is within the allowed range for n bits, where n is the minimum number of bits for the summands. If we want to avoid overflow, what is the minimum number of bits required to represent both the summands and the result? n = bits n = 8 bits c c 9 = -97 = + 56 = 59 = -97+56 = 59 [- 9, 9 -] no overflow n = bits c 8 99 = + -6 = 7 = 99-6 = 7 [- 7, 7 -] no overflow n = 8 bits c 4 = + 67 = c 8-7 = + -7 = 4+67 = [-, -] overflow! -7-7 = -64 [- 7, 7 -] overflow! To avoid overflow: n = bits (sign-etension) c c = 4 = + 67 = = 4+67 = [-, -] no overflow To avoid overflow: n = 9 bits (sign-etension) c 9 c 8 = -7 = + -7 = -64 = -7-7 = -64 [- 8, 8 -] no overflow c) Get the multiplication results of the following numbers that are represented in s complement arithmetic with 4 bits. (6 pts),,. Instructor: Daniel Llamocca

PROBLEM 4 (5 PTS) In these problems, ou can use full adders and logic gates. Make sure our circuit works for all cases. If there is overflow, design our circuit so that the final answer is alwas the correct one with the correct number of bits. a) Given two 4-bit numbers provided in gra code, sketch the circuit that computes the summation of the unsigned decimal numbers these gra codes represent. a a a a b b b b a b a b a b a b c 4 c c c c s 4 s s s s b) Given two 4-bit signed ( s complement) numbers A, B, sketch the circuit that computes (A B) 4. a b a b a b a b a b c 5 c 4 c c c c r 4 r r r r PROBLEM 5 ( PTS) s 6 s 5 s 4 s s s s a) Implement the following functions using i) decoders (and OR gates) and ii) multipleers: (5 pts) F a = Y + Z + XY F b = X Y Z w w w 4 5 6 7 s = 4 5 6 7 s = w w w 4 5 6 7 w w w 4 5 6 7 4 Instructor: Daniel Llamocca

b) Using onl a 4-to- MUX, implement the following functions. (5 pts) F a (X, Y, Z) = (m, m, m 4, m 6 ) F b (X, Y, Z) = (M, M 4, M 5, M 6 ) c) Complete the timing diagram of the circuit shown below: ( pts) s = s = w E DECODER k w E P P Unknown s s P P P P P PRIORITY ENCODER f P k f 5 Instructor: Daniel Llamocca