ECE-1021

HOMEWORK #2

(Last Mod: 27 November 2010 21:38:42 )

ECE-1021 Home


Program A

In order to exercise the entire homework submission process, submit the infamous Hello World! program according to the homework submission procedures. Your submission should be in complete compliance with the course Style Guidelines.

The basic idea of this program is covered in section 2.1 of the text except they use a different phrase than the time honored, "Hello World!"

Don't forget that your program is to adhere to the Style Guidelines. Use the source code template as your starting point and print out the header (which it already does). All you have to do for this program is add one line of code to main(), modify the header appropriately, and follow the instructions in each of the documentation sections which, for this program, mostly means deleting the instructions.

Program B

Note: This does not involve an actual program.

Reading Assignment

In addition to the Modules, you should be reading the first four chapters in the textbook. Do not worry too much about studying the information in these chapters - just read them. Make a list of items in those chapters which are new to you and/or which you don't understand. Bring that list with you to the lecture following the first exam and be sure to ask questions about anything not covered.

Note on calculator usage and showing work for this assignment.

You must show your work on all problems that require computation to receive credit.

The goal of this assignment is for you to gain proficiency in working with different number bases and number representations. As such, your work must reflect your ability to perform these operations, not the ability of the design team that developed your calculator. You may therefore use a calculator to perform base-10 computations only. Specifically, you may not use calculator functions that perform number base conversions or that permit you to work with numbers in any base other than decimal. You may use such functions to check your work only. 

Computer Based Representations

Nibbles and Bits

  1. In decimal, what is the range (minimum, maximum) of a byte, word, and dword when used to represent signed integers using a two's complement representation?

Signed Integers

Represent the following decimal values as two-byte signed integers using singed binary, offset binary, and two's complement representations. Express the results both in hex and in binary.

  1. +1,000.

  2. -1,000.

  3. +1

  4. -1

  5. -32,767

What are the decimal equivalents of the following values if each is a two-byte signed integer using a two's complement representation?

  1. 0xFFFF

  2. 0x8000

  3. 0x7FFF

  4. 0x0000

  5. 0xBEAD

  6. 0xFACE

  7. 0x6666

  8. 0x5000

Fixed Point Representation

Consider a two-byte signed fixed-point representation using two's complement and having four-bits to the right of the radix point.

  1. What is the largest positive value that can be represented?

  2. What is the smallest positive value that can be represented?

  3. What value, in decimal, is represented by a pattern of all 1's?

IEEE Floating Point Representation

For the IEEE Single Precision Floating Point Format:

  1. What is the smallest non-zero positive value that can be represented?

  2. What is the largest value that can be represented?

  3. What is the smallest value x such that 1+x can be represented?

  4. What is the static range of this representation?

  5. What is the dynamic range of this representation?

  6. How many significant figures (in decimal) does this representation have?

  7. What is the largest integer, n, such that all integers from 0 through n can be exactly represented?

  8. What is the speed of light, in meters/second, in this representation (express the bytes in hex)?

Characters and Strings

The string "ECE-1021: Homework #1" is stored at memory location 0xC000.

  1. What are the values stored at each of the relevant memory locations?

Byte Ordering and Cross Representation

Using a Little Endian protocol, the following values are stored in memory at the indicated locations:

  1. What values are in each of the sixteen bytes in the range 0xDFF0 through 0xDFFF?

  2. What value is obtained by reading a IEEE single precision floating point value from address 0xDFFC?

  3. What value is obtained by reading a Big Endian four-byte signed integer from memory location 0xDFF0?