Docsity

Computer Science Quiz: Binary and Two's Complement Representation - Prof. Richard Ord, Quizzes of Computer Science

Toggle sidebar
bg1
1
Signature __________________ Name_______________
cs30x____
Student ID _________________ Score:
Quiz 1
CSE 30
Winter 2006
#1. Show the representation of -23910 in the following representation schemes (assume 16-bit words):
a) sign magnitude
b) one’s-complement
c) two’s complement
#2. Convert 32610 into (assume 16-bit words):
a) binary
b) octal
c) hexadecimal
#3. Fill in the Condition Code bits for the following addition instructions (8-bit two’s-complement numbers):
10110110 00101010
+ 10001010 + 10011001
---------- ----------
N Z V C N Z V C
----------------- -----------------
| | | | | | | | | |
----------------- -----------------
(over)
pf2

Partial preview of the text

Download Computer Science Quiz: Binary and Two's Complement Representation - Prof. Richard Ord and more Quizzes Computer Science in PDF only on Docsity!

Signature __________________ Name_______________

cs30x____

Student ID _________________ Score:

Quiz 1

CSE 30

Winter 2006

#1. Show the representation of - 23910 in the following representation schemes (assume 16-bit words): a) sign magnitude b) one’s-complement c) two’s complement #2. Convert 32610 into (assume 16-bit words): a) binary b) octal c) hexadecimal #3. Fill in the Condition Code bits for the following addition instructions (8-bit two’s-complement numbers): 10110110 00101010

  • 10001010 + 10011001

N Z V C N Z V C


| | | | | | | | | |


(over)

#4. Powers of 2 512K = 2_____ 232 = _______ (in terms of K, M, G, etc.) #5. List the order of the stages of the compilation process discussed in class: A - exe/a.out (Executable image) B - ld (Linkage Editor) C - as (Assembler) D - ccomp (C Compiler) E - cpp (C Preprocessor) % cc/gcc file.c --> _______ --> _______ --> _______ --> _______ --> _______