# msol - EEC-70 Midterm Examination February 14, 2006 NAME...

This preview shows pages 1–3. Sign up to view the full content.

EEC-70 Midterm Examination February 14, 2006 NAME Last 4 digits ID General Instructions 1. This is a OPEN BOOK and OPEN NOTES e xamination. Calculators are allowed 2. If the information provided is not sufficient to answer a question, make appropriate assumptions and justify them. 3. Show your work otherwise you will not get any credit for the problem even if your answer is correct. 4. Maximum time allotted for this examination is 75 minutes. PROBLEM Max Points Your Score 1 5 2 15 3 10 4 10 5 20 6 12 Total 72 Problem 1 (5 points) What is the smallest number of bits required to represent the decimal values –12000 to +8000 in two’s complement binary notation? Show how you arrived at your answer to receive full credit. In two’s complement the range of numbers with n bit is -2 n-1 to 2 n-1 – 1 so the value of n is 15 with which you can represent –16384 to 16383 which covers the range we are interested in. With n=14 you can represent –8192 to 8191 which does not satisfy the range we are interested in.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
EEC-70 Midterm Examination February 14, 2006 Problem 2 The high-level language statement IF (A>0) B = C div A; ELSE B = A + 10; was given to two SAL programmers Bob and Mary. Bob translated it as follows: BLEZ A, elsepart DIV B, C, A B endif elsepart: ADD B, A, 10 endif : Mary translated the same code as shown below: DIV B, C, A BGTZ A, endif ADD B, A, 10 endif : Part(a) Give two reasons why Mary’s translation maybe superior to Bob’s translation. You have to be
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 06/28/2008 for the course EEC 70 taught by Professor Wilken during the Spring '05 term at UC Davis.

### Page1 / 5

msol - EEC-70 Midterm Examination February 14, 2006 NAME...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online