CONCORDIA UNIVERSITY Department of Computer Science and Software Engineering COMP 228/4 Section PP Midterm Exam

Similar documents
Name: CMSC 313 Fall 2001 Computer Organization & Assembly Language Programming Exam 1. Question Points I. /34 II. /30 III.

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

ECE 341 Midterm Exam

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

2. (a) Compare the characteristics of a floppy disk and a hard disk. (b) Discuss in detail memory interleaving. [8+7]

Number Systems. Binary Numbers. Appendix. Decimal notation represents numbers as powers of 10, for example

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

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

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

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

Computer Organisation CS303

mith College Computer Science CSC231 - Assembly Week #3 Dominique Thiébaut

We can study computer architectures by starting with the basic building blocks. Adders, decoders, multiplexors, flip-flops, registers,...

Birkbeck (University of London) Department of Computer Science and Information Systems. Introduction to Computer Systems (BUCI008H4)

Introduction to Computer Science-103. Midterm

Experimental Methods I

ECE 341 Midterm Exam

CHAPTER 4: Register Transfer Language and Microoperations

Birkbeck (University of London) Department of Computer Science and Information Systems. Introduction to Computer Systems (BUCI008H4)

Code No: R Set No. 1

Data Representation Type of Data Representation Integers Bits Unsigned 2 s Comp Excess 7 Excess 8

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

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

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

Computer Systems and Networks. ECPE 170 Jeff Shafer University of the Pacific. Exam 1 Review

Operations On Data CHAPTER 4. (Solutions to Odd-Numbered Problems) Review Questions

REGISTER TRANSFER AND MICROOPERATIONS

Microcomputers. Outline. Number Systems and Digital Logic Review

Final Examination (Open Katz, asynchronous & test notes only, Calculators OK, 3 hours)

OCR H446 A-Level Computer Science

Sample Exam I PAC II ANSWERS

COMP Overview of Tutorial #2

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

Real Digital Problem Set #6

Chapter 4. Operations on Data

Question Total Possible Test Score Total 100

GATE CSE. GATE CSE Book. November 2016 GATE CSE

Number Systems. Both numbers are positive

CDS130 Mid-term exam: Sample


EE 109L Final Review

REGISTER TRANSFER AND MICROOPERATIONS

UNCA CSCI 255 Exam 1 Spring February, This is a closed book and closed notes exam. It is to be turned in by 1:45 PM.

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

CDA 3103 Computer Organization Exam 1 (Sep. 22th, 2014)

Signed umbers. Sign/Magnitude otation

11/22/1999 7pm - 9pm. Name: Login Name: Preceptor Name: Precept Number:

CHW 261: Logic Design

±M R ±E, S M CHARACTERISTIC MANTISSA 1 k j

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column

Representation of Non Negative Integers

1. Draw general diagram of computer showing different logical components (3)

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

EE 109L Review. Name: Solutions

Combinational and sequential circuits (learned in Chapters 1 and 2) can be used to create simple digital systems.

An instruction set processor consist of two important units: Data Processing Unit (DataPath) Program Control Unit

Computer Organization (Autonomous)

Data Representation and Architecture Modeling Year 1 Exam preparation

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

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

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

Introduction to Computers and Programming. Numeric Values

Floating Point Arithmetic

Inf2C - Computer Systems Lecture 2 Data Representation

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

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

SUBJECT CODE: IT T35 DIGITAL SYSTEM DESIGN YEAR / SEM : 2 / 3

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

CS61c Midterm Review (fa06) Number representation and Floating points From your friendly reader

Digital Fundamentals. Lab 6 2 s Complement / Digital Calculator

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

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Lec-6-HW-3-ALUarithmetic-SOLN

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

ECE 30 Introduction to Computer Engineering

END-TERM EXAMINATION

Arithmetic Logic Unit

ECOM 2325 Computer Organization and Assembly Language. Instructor: Ruba A.Salamah INTRODUCTION

Introduction to Computer Science. Homework 1

CS/COE 0447 Example Problems for Exam 2 Spring 2011

(+A) + ( B) + (A B) (B A) + (A B) ( A) + (+ B) (A B) + (B A) + (A B) (+ A) (+ B) + (A - B) (B A) + (A B) ( A) ( B) (A B) + (B A) + (A B)

Computer Organization and Architecture (CSCI-365) Sample Final Exam

mith College Computer Science CSC231 - Assembly Week #8 Dominique Thiébaut

Chapter 4. Combinational Logic

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Chapter Overview. Welcome to Assembly Language

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

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.

Code No: R Set No. 1

Written exam for IE1204/5 Digital Design Thursday 29/

3. The high voltage level of a digital signal in positive logic is : a) 1 b) 0 c) either 1 or 0

CMPT 250 : Week 3 (Sept 19 to Sept 26)

Course Syllabus [1/2]

FLOATING POINT NUMBERS

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM

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

Combinational Circuits

ECE20B, Spring Final Exam lab questions.

CSE 140 Homework One

Arab Open University. Computer Organization and Architecture - T103

mith College Computer Science Fixed & Floating Point Formats CSC231 Fall 2017 Week #15 Dominique Thiébaut

Transcription:

1 CONCORDIA UNIVERSITY Department of Computer Science and Software Engineering COMP 228/4 Section PP Midterm Exam Instructor: Tadeusz S. Obuchowicz Date: Tuesday, February 28, 2012 Time Allowed: 1 hour and 30 minutes Instructions: Closed book/closed notes No calculators allowed, no laptops allowed, no cell phones allowed. Answer all 5 questions. If you make any assumptions clearly indicate so in your answer booklets. Question 1: [ 20 points ] (Integer binary numbers) (a) Represent the decimal numbers -9 and -7 using (i) 5-bit sign magnitude notation (ii) 5-bit two s complement notation. (b) Perform the operation -(9) + (-7) using the rules of 5-bit sign magnitude addition. Indicate whether overflow occurs. (c) Perform the multiplication of (-5) x (+3) using the Booth algorithm assuming 5-bit two s complement notation is used for the multiplicand and multiplier. Show all your steps. Question 2: [ 20 points ] (Floating point representation) Consider a 8-bit floating point format similar to the IEEE 754 notation, but simplified somewhat such that it is amenable for hand calculations. The base is 2 and the exponent is stored in 3 bits using excess-4 notation, the two end values of the stored exponent (namely 0 and 7) are used as special cases to represent exact 0.0 and infinity respectively. The most significant bit is used to represent the sign of the number with 0 designating a positive number and 1 representing a negative number. The mantissa is stored using 4 bits and is normalized in a manner similar to that of the IEEE 754 format, i.e. there is a hidden or implied 1 to the left of the binary point. It is often said that a picture is worth a thousand words, so Figure 1 illustrates this floating point format.

2 8 bits 3 bit exponent in excess 4 notation 4 bit mantissa 1 bit for sign 0 = positive 1 = negative Figure 1: A 8-bit mini IEEE floating point format. (a) Express the decimal number +6.9 using this format. Express your answer as a 8-bit binary number identifying clearly which bits represent the sign, exponent, and mantissa. (b) What decimal number does the value 6B 16 represent in this floating point format? Question 3: [ 20 points ] (Karnaugh Maps) (a) Obtain the minimal sum-of-products Boolean expressions for the F 2,F 1, and F 0 outputs of the following truth table which has inputs X,Y, and Z. Use three separate 3-variable K-maps to perform the minimization. Indicate clearly on your K-maps the groupings of 1 s which make up the chosen prime implicants. Table 1: A truth table X Y Z F 2 F 1 F 0 0 0 0 0 0 0 0 0 1 1 1 1 0 1 0 1 1 0 0 1 1 1 0 1 1 0 0 1 0 0 1 0 1 0 1 1 1 1 0 0 1 0 1 1 1 0 0 1 (b) Draw the logic circuits of the three sum-of-product equations obtained in part (a). You may assume that the true and complemented forms of the input variables are available.

3 (c) State in a clear English sentence the operation specified by the truth table and implemented by the hardware obtained in part (b). For example, you should phrase your answer similar to: The given truth table specifies that the output is the 3-bit Hamming code of the given input values Of course, the real answer is something completely different. This example is given merely to illustrate how one should phrase the answer. Note: Answers of the form: The truth table specifies that when the input is 000, the output should be 000, when the input is 001, the output should be 111, when the input is 010 the output should be 110, etc. will receive a grade of 0. Hint: The hardware shown in Figure 1 gives the same results as the given truth table: X Y Z 0 0 0 in_1 cout in_2 in_1 in_2 in_1 in_2 cin cout cin cout cin 1 sum sum sum F F F 2 1 0 each box represents a full adder cell Figure 1: Hardware which implements the functionality of the Table 1. Question 4: [ 20 points ] (Sequential Logic: flip-flops and timing diagrams) Consider the circuit illustrated in Figure 2 consisting of two positive edge-triggered D-type flipflops with selective load capability, an input bus, an output bus and two tri-state buffers.

4 in_bus clock 01 01 D ld_mick D ld_keith MICK KEITH Q_mick Q_keith en_mick en_keith out_bus Figure 2: A simple bus circuit. Complete the timing diagram which is included at the end of this exam. Write your name and ID number in the space provided and remove the last page of this exam and insert it into your answer booklets. Indicate in the provided timing diagram the behaviour of the two flop outputs (q_mick and q_keith) as well as the behaviour of out_bus between the indicated start and end times. Use the symbol Z to denote when the bus is in the high impedance (tri-state value) state. In the provided timing diagram, it is assumed that the initial value of q_mick is logic 0 and that the initial value of q_keith is logic 1. Note also that the timing diagram intentionally contains a fatal design error. You are to explain in words (in your answer booklet) the nature of this design error and to indicate (on the provided timing diagram) when this error occurs. HINT: use the word FIRE to indicate the state of the out_bus at that point in time when the design error occurs.

5 Question 5: [ 20 points ] (Intel Assembly Language Programming) Consider the following Intel assembly language listing file: 1 ; Ted Obuchowicz 2 ; Thu Feb 23 21:00:27 EST 2012 3 ; PROGRAM 1 4 section.data 5 6 00000000 0102030405 number: db 1,2,3,4,5 7 00000005 00 sum: db 0 8 9 10 section.text 11 global _start 12 13 _start: 14 00000000 B905000000 keith: mov ecx, 5 15 00000005 B800000000 ron: mov eax, 0 16 0000000A BB[00000000] mov ebx, number 17 0000000F 0203 again: add al, [ebx] 18 00000011 81C301000000 add ebx,1 19 00000017 81E901000000 sub ecx,1 20 0000001D 75F0 jnz again 21 0000001F A2[05000000] mov [sum], al 22 23 00000024 B801000000 mov eax,1 24 00000029 BB00000000 mov ebx,0 25 0000002E CD80 int 80h (a) When this program is run, what value will be stored in memory location sum? Give your answer in hexadecimal notation. (b) What is the significance of the value F0 in line 20 (indicated in bold font)? Now, consider the following Intel assembly language listing file: 1 ; Ted Obuchowicz 2 ; Thu Feb 23 21:06:24 EST 2012 3 ; PROGRAM 2 4 section.data 5 6 00000000 0102030405 number: db 1,2,3,4,5 7 00000005 00 sum: db 0 8 9 10 section.text 11 global _start 12 13 _start: 14 00000000 B905000000 keith: mov ecx, 5 15 00000005 B800000000 ron: mov eax, 0

6 16 0000000A BB[00000000] mov ebx, number 17 0000000F 81C304000000 add ebx, 4 18 00000015 0203 again: add al, [ebx] 19 00000017 4B dec ebx ;decrement ebx 20 00000018 49 dec ecx ;decrement ecx 21 00000019 75FA jnz again 22 0000001B A2[05000000] mov [sum], al 23 24 00000020 B801000000 mov eax,1 25 00000025 BB00000000 mov ebx,0 26 0000002A CD80 int 80h (c) Does this program perform the same task as the first program (PROGRAM 1)? What value will be stored by PROGRAM 2 in memory location sum? Are there any differences between the two programs? (d) What is the significance of the value FA in line 21 of PROGRAM 2? (e) If these programs are stored in a memory which is byte-organized (i.e a memory in which every memory read access results in one byte of information being read from the memory) which program will execute faster? Justify your answer.

7 WRITE YOUR NAME AND ID IN THE SPACE PROVIDED. REMOVE THIS PAGE AND INSERT IT INTO YOUR ANSWER BOOKLET. NAME: ID: TIMING DIAGRAM FOR QUESTION 4. start end clock in_bus ld_mick ld_keith en_mick en_keith q_mick q_keith out_bus Z