UNIVERSITY OF WISCONSIN MADISON

Similar documents
CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

UNIVERSITY OF WISCONSIN MADISON

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

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

UNIVERSITY OF WISCONSIN MADISON

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

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

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

Introduction to Computer Science-103. Midterm

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems

UNIT 7A Data Representation: Numbers and Text. Digital Data

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON. Instructor: Rahul Nayar TAs: Annie Lin, Mohit Verma

Floating Point Arithmetic

Time (self-scheduled): Location Schedule Your Exam: What to bring:

Chapter 4. Operations on Data

Introduction to Computers and Programming. Numeric Values

COMP Overview of Tutorial #2

Signed umbers. Sign/Magnitude otation

IBM 370 Basic Data Types

Number System. Introduction. Decimal Numbers

Integers. N = sum (b i * 2 i ) where b i = 0 or 1. This is called unsigned binary representation. i = 31. i = 0

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

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

Time: 8:30-10:00 pm (Arrive at 8:15 pm) Location What to bring:

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

CS101 Lecture 04: Binary Arithmetic

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

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

Number Systems. Both numbers are positive

Signed Binary Numbers

COMP2611: Computer Organization. Data Representation

Chapter Three. Arithmetic

Numeric Encodings Prof. James L. Frankel Harvard University

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

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON

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. Binary Numbers. Appendix. Decimal notation represents numbers as powers of 10, for example

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

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

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING COMPUTER SCIENCES DEPARTMENT UNIVERSITY OF WISCONSIN-MADISON

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

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

FLOATING POINT NUMBERS

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

CMPSCI 145 MIDTERM #2 SPRING 2017 April 7, 2017 Professor William T. Verts NAME PROBLEM SCORE POINTS GRAND TOTAL 100

3 Data Storage 3.1. Foundations of Computer Science Cengage Learning

N.B. These pastpapers may rely on the knowledge gained from the previous chapters.

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

CMPSCI 145 MIDTERM #1 Solution Key. SPRING 2017 March 3, 2017 Professor William T. Verts

CS & IT Conversions. Magnitude 10,000 1,

104 - Introduction to Computer Science - Midterm Exam

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

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

Groups of two-state devices are used to represent data in a computer. In general, we say the states are either: high/low, on/off, 1/0,...

Numbers and Computers. Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras

Chapter 3: Arithmetic for Computers

Number System (Different Ways To Say How Many) Fall 2016

MACHINE LEVEL REPRESENTATION OF DATA

Representation of Non Negative Integers

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

Chapter 2 Bits, Data Types, and Operations

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

Chapter 10 Binary Arithmetics

Chapter 2 Bits, Data Types, and Operations

Computer Organisation CS303

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


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

Internal Data Representation

Chapter 2 Bits, Data Types, and Operations

World Inside a Computer is Binary

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

Principles of Computer Architecture. Chapter 3: Arithmetic

Chapter 2. Positional number systems. 2.1 Signed number representations Signed magnitude

Objectives. Connecting with Computer Science 2

IEEE Standard for Floating-Point Arithmetic: 754

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

NAME: 1a. (10 pts.) Describe the characteristics of numbers for which this floating-point data type is well-suited. Give an example.

Computer System and programming in C

Advanced Computer Architecture-CS501

unused unused unused unused unused unused

Inf2C - Computer Systems Lecture 2 Data Representation

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

Survey. Motivation 29.5 / 40 class is required

Introduction to Computer Science (I1100) Data Storage

ECE 372 Microcontroller Design Assembly Programming Arrays. ECE 372 Microcontroller Design Assembly Programming Arrays

Representation of Information

Binary. Hexadecimal BINARY CODED DECIMAL

The type of all data used in a C (or C++) program must be specified

4/8/17. Admin. Assignment 5 BINARY. David Kauchak CS 52 Spring 2017

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

CDS130 Mid-term exam: Sample

Recap from Last Time. CSE 2021: Computer Organization. It s All about Numbers! 5/12/2011. Text Pictures Video clips Audio

CSC201, SECTION 002, Fall 2000: Homework Assignment #2

ECE 250 / CS 250 Computer Architecture. C to Binary: Memory & Data Representations. Benjamin Lee

Data Representation 1

COMP2121: Microprocessors and Interfacing. Number Systems

Transcription:

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON Prof. Gurindar Sohi TAs: Lisa Ossian, Minsub Shin, Sujith Surendran Midterm Examination 1 In Class (50 minutes) Wednesday, September 24, 2014 Weight: 17.5% NO: BOOK(S), NOTE(S), OR CALCULATORS OF ANY SORT. The exam has nine pages. You must turn in the pages 1-8. Circle your final answers. Plan your time carefully since some problems are longer than others. Use the blank sides of the exam for scratch work. LAST NAME: FIRST NAME: ID#: 1

Problem Maximum Points Points Earned 1 2 2 1 3 1 4 2 5 2 6 4 7 4 8 1 9 5 10 2 11 2 12 4 Total 30 2

Problem 1 Label the following items/terms according to their level of abstraction relative to one another. Label the most abstract term as 1 and least abstract as 6. Instruction Set Architecture (ISA) Code in High level language (C/C++/Java) Problem Statement / Application Algorithm to solve problem Micro Architecture Transistors (CMOS or NMOS) Problem 2 Mention one difference between a high level language and an assembly language? (1 Point) Problem 3 Explain why natural languages cannot be used as programming languages? (1 Point) 3

Problem 4 There are 65 birds on a tree. a) How many bits are required to uniquely represent all birds? b) If the number of birds on the tree were to decrease so that only 5 bits will be required to uniquely represent them, what is the maximum number of birds that could be on the tree? Problem 5 Using 8 bits to represent each number, write the representations of 24 and -24 in sign-magnitude and 2's complement notations. Number Sign-magnitude 2 s complement 24-24 4

Problem 6 (4 Points) Perform binary arithmetic for the following pairs of 2 s complement numbers. Write your result in binary. Indicate if there is an overflow. a) 011010 + 011111 ------ Did overflow occur? b) 00100111-00001110 -------- Did overflow occur? Problem 7 (4 Points) Perform the specified logical operations on the following binary numbers. Express your result in hexadecimal. a) 00010110 AND (NOT(10111010)) b) 1000 OR (1010 OR 0001) 5

Problem 8 (1 Point) You have an 8-bit fixed point binary notation, with 5 bits for the integer part, i.e., 5 bits to the left of the binary point, and 3 bits for the fractional part, i.e., 3 bits to the right of the binary point. Represent the decimal 5.125 in this fixed point notation. Problem 9 Convert the decimal value -10.25 into its IEEE single-precision floating point representation. (5 Points) The bits for the IEEE single-precision floating point number (N) are allocated as follows: Sign (1 bit) Exponent (8 bits) Fraction (23 bits) Where the value N = (-1) Sign x 1.Fraction x 2 Exponent-127 6

Problem 10 Suppose we have an eight-bit pattern in which the leftmost 4 bits are of interest. For example, the computer could be asked to perform some tasks depending on the value stored in the leftmost 4 bits of A. How can we isolate those 4 bits of interest? Demonstrate on A = 1101 0101. (To isolate means to make all the bits that are not of interest equal to 0, while leaving the bits of interest as they are. For example, if 8-bit string is 1111 1111 and the bit of interest is the rightmost bit, your output should be 0000 0001.) Problem 11 Consider an n-bit 2 s complement representation. a) What is the largest decimal number that can be represented with an n-bit 2 s complement number? b) What is the smallest decimal number that can be represented with an n-bit 2 s complement number? (Note: -2 is smaller than -1.) 7

Problem 12 (4 Points) The ASCII table on the last page will be useful in solving this problem. You can detach it to make it easier to consult without flipping pages while solving this problem. Consider two strings of two ASCII characters each: A@ and $1. The ASCII characters in the string are the two characters between the quotation marks, and there is no null character terminating the string. First, convert each of these two strings into their corresponding 16-bit binary values. Now, suppose that the two 16-bit binary values were added as if they were unsigned integers, and the resulting 16 bits treated as they were a string of ASCII characters. What would the resulting ASCII string be? 8

9