Docsity

Program Execution and Data Representation: Lecture Notes, Exercises of Computer Science

Toggle sidebar
bg1
Module 1 (Lectures 1-2) Program execution and Data Representation
1. The maximum unsigned integer value that can be represented in 8 bits is
a) 127
b) 128
c) 255
d) 256
2. You can get the GNU C compiler to produce an assembly language equivalent of
your C source program using the compiler flag
a) -a
b) -S
c) -p
d) -x
3. In sign-magnitude representation, the signed integer value -2 will be represented
in 8 bits as
a) 10000001
b) 10000010
c) 00000001
d) 00000010
4. The IEEE floating point uses a normalized representation in order to
a) ensure that each real value has a unique representation
b) reduce the number of bits needed to represent the exponent
c) remove the need for a sign bit
d) provide a way to represent infinity
5. A program written in a high level language is compiled before it is executed in
order to
a) identify logical errors in the program
b) improve the formatting of the program statements
c) produce a program that can be executed on hardware
d) test the program thoroughly before it is used in the field
Docsity.com

Partial preview of the text

Download Program Execution and Data Representation: Lecture Notes and more Exercises Computer Science in PDF only on Docsity!

Module 1 (Lectures 1 - 2 ) Program execution and Data Representation

  1. The maximum unsigned integer value that can be represented in 8 bits is a) 127 b) 128 c) 255 d) 256
  2. You can get the GNU C compiler to produce an assembly language equivalent of your C source program using the compiler flag a) - a b) - S c) - p d) - x
  3. In sign-magnitude representation, the signed integer value - 2 will be represented in 8 bits as a) 10000001 b) 10000010 c) 00000001 d) 00000010
  4. The IEEE floating point uses a normalized representation in order to a) ensure that each real value has a unique representation b) reduce the number of bits needed to represent the exponent c) remove the need for a sign bit d) provide a way to represent infinity
  5. A program written in a high level language is compiled before it is executed in order to a) identify logical errors in the program b) improve the formatting of the program statements c) produce a program that can be executed on hardware d) test the program thoroughly before it is used in the field

Docsity.com