BME303 Lab 3 - Digital Logic and Number Systems - Prof. Orly Alter, Lab Reports of Biology

The instructions and problems for lab 3 of the bme303 course in spring 2008. Students are required to complete various digital logic and number systems problems using binary, decimal, and hexadecimal representations. The problems involve addition, complements, and logic operations.

Typology: Lab Reports

Pre 2010

Uploaded on 08/30/2009

koofers-user-nmw
koofers-user-nmw 🇺🇸

10 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
BME303 Spring 2008 Lab 3
1
Last Name:
First Name:
.
Instructions:
1. Use the first page of this document as the cover page.
2. Each homework must be stapled [50 points are deducted otherwise].
3. The first page of the homework must have a completed heading as above
(it can be hand written).
4. Show your work, except in the most obvious cases where the calculations
can be done mentally.
5. Your work must be neat and clear.
Problem 1 [4 + 2 = 6]
a) You have a 4 bit computer, i.e. a computer that can only do 4 bit binary
arithmetic and everything beyond the 4th bit cannot be represented.
Complete the following addition table where you add the binary number in
the ith column with the jth row. The numbers are represented using 2s
complement format. An example is given to get you started.
0011
1110
0110
1010
0001
0111
0011
0111
1111
b) Is there an overflow in some additions (circle if any)
Problem 2 [2+2+2+2 = 8]
In the following table, the 1st column represents a bit pattern on an 8 bit computer
(i.e. anything beyond 8 bits is not represented).
Column A: Write the 1s complement of the initial bit pattern.
Column B: Write the 2s complement of the initial bit pattern.
Column C: Write the 2s complement of the number in column B.
Column D: Write the addition of the numbers in columns B and C.
Initial Pattern
A
B
C
D
1111 1111
0011 0011
1010 1010
0000 0000
pf3
pf4
pf5

Partial preview of the text

Download BME303 Lab 3 - Digital Logic and Number Systems - Prof. Orly Alter and more Lab Reports Biology in PDF only on Docsity!

Last Name: First Name:. Instructions:

1. Use the first page of this document as the cover page.

  1. Each homework must be stapled [50 points are deducted otherwise].
  2. The first page of the homework must have a completed heading as above (it can be hand written).
  3. Show your work, except in the most obvious cases where the calculations can be done mentally. 5. Your work must be neat and clear. Problem 1 [4 + 2 = 6] a) You have a 4 bit computer, i.e. a computer that can only do 4 bit binary arithmetic and everything beyond the 4 th^ bit cannot be represented. Complete the following addition table where you add the binary number in the ith^ column with the jth^ row. The numbers are represented using 2 ’s complement format. An example is given to get you started. 0011 1110 0110 1010 0001 0111 0011 0111 1111 b) Is there an overflow in some additions (circle if any) Problem 2 [2+2+2+2 = 8] In the following table, the 1 st^ column represents a bit pattern on an 8 bit computer (i.e. anything beyond 8 bits is not represented). Column A: Write the 1’s complement of the initial bit pattern. Column B: Write the 2’s complement of the initial bit pattern. Column C: Write the 2’s complement of the number in column B. Column D: Write the addition of the numbers in columns B and C. Initial Pattern A B C D 1111 1111 0011 0011 1010 1010 0000 0000

Problem 3 [4] Add the following two’s complement numbers and express the answers in both binary and decimal. (The table is provided for your convenience) 1 0 1 1 + 01011001 =

Binary Decimal Problem 4 [4] Calculate the results of the following arithmetic operations on 16-bit 2's complement numbers. The numbers are encoded in hexadecimal, as indicated by the prefix "0x". You may do the calculations in binary, decimal or hex, but convert your answer to hexadecimal. State whether overflow has occurred (circle one). 0x0224 – 0x Answer: Circle one: overflow no overflow Problem 5 [3+3+3+3+3+3 = 18] a. What is the minimal number of bits needed to represent the following 2 ’s complement numbers written in hexadecimal format ( “0x” is the prefix that indicates the hexadecimal format):

Problem 8 [4+4+4+4 = 16] Find the equivalent IEEE 754 floating point representation for the decimal numbers below. a) -0. b) 65. c) 2048 d) -118. Problem 9 [2+2+2+2+2=10] Compute the following logic operations. Write your results in binary. (You can use the tables to facilitate the calculations, but you don’t have to) a) 10101010 AND 10100011 b) 00111101 OR 01011111 c) (( 11000011 ) OR (NOT( 01110111 ))) AND (NOT( 00000000 )) d) (NOT( 00111011 ) NOR (NOT( 00001111 ))) NAND (NOT( 00011100 )) (Add more rows to the table if you need to.)

e) (NOT( 01100110 ) NAND ( 00111101 )) NOR (NOT( 11011100 )) (Add more rows to the table if you need to.) Problem 10 [10] Fill up the blanks in the truth table with suitable values. Output1 = NOT(Y) NAND (NOT(Z) OR X) Output2 = Y AND (X OR NOT(Z)) Output3 = NOT(X) NOR (Z AND NOT(Y)) X Y Z NOT X

NOT

Z

NOT

Y

Y

AND

Z

NOT

(Y)

OR Z

Out 1

Y

OR

Z

NOT

(Y OR

Z)

X OR

NOT(Z)

Out 2 Out 3 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1