



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A midterm exam for a university-level electrical and computer engineering (ece) course, specifically ece 190, from the spring 2011 semester. The exam covers various topics such as binary representation, digital logic, memory, and c language. Students are required to answer multiple-choice problems and provide their own solutions for certain questions. The exam includes instructions, five pages of problems, and a total of 30 points.
Typology: Exams
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Spring 2011 Monday, February 14, 2011 Name: NetID:
Problem 1 (10 points): Binary representation Part A (2 points): What range of decimal numbers can be represented using 7 bits in each 2’s complement, 1’s complement, and unsigned binary representations? 2’s complement: _____________________ 1’s complement: _____________________ Unsigned binary: _____________________ Part B (2 points): Convert decimal number - 64 into signed magnitude, 2’s complement, and 1’s complement binary representations using the minimum number of bits. Signed magnitude: _____________________ 2 ’s complement: _____________________ 1 ’s complement: _____________________ Part C (1 point): How is the number 32.375 represented in the floating point data type format? Answer: _________________________________________________ Part D ( 2 points): What is the smallest possible positive number that can be expressed in the floating point data type, using an exponent between 1 and 254? Write your answer in binary, in IEEE 754 floating point format. Answer: _________________________________________________ Part E ( 3 points): Using binary integer arithmetic, what 32-bit pattern can be added to this floating point representation to effectively multiply it by 2? 0 01111111 01010101010101010101010 Answer: _________________________________________________
Problem 3 ( 10 points): Memory In this problem you will be working with 2x1-bit memory cells. Each cell stores 2 bits which can only be accessed one at a time. Which bit is accessed is determined by the address input to the memory cell. Given four 2x1-bit memory cells, build a 4x2-bit memory unit using only AND, OR, NOT gates and MUXes.
Problem 4 (5 points): C language Part A (1 points): Assume variables x , y , and z are already declared. Write a C expression to evaluate !! ! + 4!
Do not switch the order of operands. Answer: ___________________________________________________ Part B (2 points): Fill in missing expressions to implement the following formula: ! =
if ( _________________________________________ ) f = x + 10; else if ( ____________________________________ ) f = x - 10; else f = x; Part C (1 points): Write the output produced by the following code segment: int x = 5; while (x < 10 ) printf(“%d “, ++x); Answer: ____________________________________________ Part D (1 points): Using only declared variables, write missing arguments in scanf function call that correspond to the provided format conversion specifications. int count; float temp; char inchar; scanf(“%c %f %d”, _________________________________________ );