COMP-4 Mid-term Exam SOLUTIONS

1.  Give a clear definition of what a computer is (not what it is composed of)?

A computer is a device that accepts input, processes data, stores data and produces output. Also, a device that transforms a stream of input symbols to a stream of output symbols (symbol manipulator).

History

2.  What was the fundamental motivation for the development of computers?

The need to perform tedious and repetitive arithmetic calculations accurately.

3.  Name 3 specific examples of what the first electronic computers were used for?

·  constructing navigation tables.

·  Flight trajectory tables

·  Census ( UNIVAC)

·  Inventory and budget

·  Cracking German code

· 

· 

· 

· 

· 

· 

4.  What was the major significance of Babbage’s Analytical Engine towards the progress of computing?

·  First time someone designed a machine independent of its ultimate purpose.

·  Birth of distinction between software and hardware

·  First programmable computer (through the use of punched cards)

5.  Why were binary numbers used in electronic computers?

Because of the engineering simplicity of representing binary numbers by on/off switches.

6.  What do mechanical relays, vacuum tubes, and transistors have in common?

They are all binary switches that have just two states.

7.  Why was the vacuum tube so important to the development of electronic computers?

Vacuum tubes are much faster switches than the mechanical relays used at that time.

8.  What two technologies replaced vacuum tubes? Why?

Transistor and IC. They are faster, cheaper, more reliable, consume less energy, and can be made much smaller than vacuum tubes.

9.  What motivated the need for an operating system in early computers? What did it replace?

The complexity of controlling the computer hardware made it difficult to use the computers and to program them. Time and resources were wasted in maintaining the computers. The operating system replaced human operators.

10.  What is the “Turing test”?

A test devised by Alan Turing to determine if a machine could be considered to possess some intelligence.

Software:

11.  Define the following concepts: software, program, operating system, device driver

Software - programs and their associated data

Program - a set of instructions for a computer to perform a certain task

Operating system - software that controls the fundamental operations of a computer

Device driver - software that allows the OS to communicate with hardware devices

12.  Name three tasks performed by an operating system.

·  Controls basic input and output

·  Allocates system resources

·  Manages files and storage space

·  Detects equipment failure

·  Maintains security

·  Control execution of programs

·  Provides user and simpler interface to the computer user and computer programmer

13.  Name three different operating systems.

·  Windows

·  Mac OS

·  UNIX, Linux

·  DOS

14.  What is a compiler?

Software that translates a high level language into a lower level language (usually machine language).

15.  How does machine language and high-level programming languages differ?

·  High level languages are more human readable and are translated/interpreted by compilers.

·  A machine language is in binary code and is directly executed by the computer. It usually has
fewer simpler instructions than a high-level language.

16.  In what situations is it legal to make a copy of copyrighted software?

To back up the software that you own.

17.  What is pirated software, shareware, public domain software?

·  pirated software – illegally copied and distributed software

·  shareware – “try before you buy” software

·  public domain software – software that are freely distributed.

Data Storage and Representation:

18.  How many bits are needed to represent the number 123 as numeric data?

7

19.  How many bits are needed to represent the number 123 as character data?

24

20.  Given a character data stream of bits, how do we know where one character ends and another begins?

Every character is represented by a fixed number of bits. ( 8 in the case of ASCII characters ) So, every 8 bits is another character.

21.  What is the ASCII character set? How is it used?

ASCII (American Standard Code for International Interchange) defines a set of 256 possible characters called the

ASCII table. It is used to encode the symbolic character data.

22.  How many bytes are needed to represent the character data Hi, everyone! ?

13

Hardware and Architecture

23.  Name four of the main components inside the system unit?

·  Motherboard

·  Microprocessor chip or CPU

·  Drives: floppy, hard, ZIP, CD, DVD

·  Memory: RAM

·  Power supply

·  Wires and ribbon cables

·  Expansion slots and cards

24.  Name four of the main components on a microcomputer motherboard?

·  Microprocessor or CPU

·  Memory: RAM, ROM

·  System Bus

·  Drive Controllers

·  Expansion slots and cards

·  External ports

·  Real-time Clock

25.  What are the 2 main differences between RAM and ROM?

ROM is read-only and RAM can do both read and write.

ROM is non-volatile and RAM is volatile.

26.  What are the main differences between RAM and hard disk storage?

RAM: volatile, fast, relatively expensive, used as temporary data storage for CPU.

Hard disk: non-volatile, slow, relatively inexpensive, used as permanent data storage.

27.  What is the CPU and what are its functions?

CPU stands for Central Processing Unit and it performs arithmetic and logic operations, and executes program instructions.

28.  The expression “The number of transistors on a chip will double every 18-24 months” is called what? What does this loosely imply?

Moore’s Law. The speed of the CPU will grow faster at an exponential rate (performance roughly doubles)

29.  What are the physical components of the computer typically referred to? What is the design of the logical layout and connections between these physical components referred to?

Computer hardware; Computer architecture.

30.  What is the instruction cycle and clearly describe its steps?

The instruction cycle is the process in which a computer executes a single instruction. Often called the Fetch-Decode-Execute cycle. Here are the steps:

·  Fetch: control unit loads instruction from memory location in PC into IR

·  Decode: control unit interprets instruction

·  Execute: control unit executes instruction (tells ALU what to do)

·  Increment PC: PC is incremented to next program instruction and cycle repeats

31.  What is the purpose of registers in the ALU?

Registers hold values that are needed in operations performed by the ALU. ALU handles the arithmetic and logical operations in a CPU.

32.  What is a cache and describe its purpose?

A cache is smaller and faster memory that is used to store frequently used memory values in order to improve memory access performance. When CPU attempts to access memory, it first looks for the data in the cache before going to the slower larger memories

33.  What is a cache miss? Cache hit?

If data is found in the cache, it is called a cache hit. Otherwise, it is a cache miss.

34.  What does “locality of memory references” mean?

The idea that frequently accessed data tends to be close together in memory.

35.  Describe the memory hierarchy, starting with the CPU.

A collection of memories ranging from the largest and slowest hard disk drive to the smallest and fastest on-chip L1 cache.

CPU à cache( L1, L2, …) à main memory à disk controller cache à hard disk storage.


Units and Conversion

36.  How many bits are in 10GB (write the mathematical expression only)?

37.  How many 8-bit ASCII characters will fit on a 3.5” 1.44MB floppy disk?

characters

38.  The 8-bit ASCII table needs 8 bits to represent its 256 different symbols. If you had a character table with only 16 different symbols, how many of these characters could fit on a 3.5” 1.44MB floppy disk?

16 symbols needs 4 bits to represent. The number of the 4-bit characters a 1.44 MB disk can hold is then
characters

Counting, Number systems, and Arithmetic:

39.  What does the word “bit” stand for?

Binary digit.

40.  What does the “base” of a numbering system refer to?

The number of different symbols that are used to write a single digit of a number. The base “power” of a place of a digit in a number.

41.  What does binary, octal, and hexadecimal mean?

They stand for different base number systems:

·  binary: base 2

·  octal: base 8

·  hexadecimal: base 16

42.  Give the next three numbers after 111012? After FBFFE16? After 7668? After 45?

11110, 11111, 100000
FBFFF, FC000, FC001

767, 770, 771

10, 11, 12

43.  Evaluate the following binary arithmetic expressions:

a.  110111+101110
1100101

b.  10110000-01101
10100011

c.  1111*111
1101001

d.  1010111/110
1110 r 11

e.  101101110111*210, 101101110111/210
1011011101111, 10110111011 r 1

f.  ((1011+1100)*(1001-110))-(11011/11)
111100

44.  Write the expression for the decimal expansion for the following numbers:
101102, 20378, FFAB916
1*24 + 0*23 + 1*22 + 1*21 + 0*20
2*83 + 0*82 + 3*81 + 7*80
15*164 + 15*163 + 10*162 + 11*161 + 9*160

45.  Convert the following numbers to decimal: 1011012, 1078, 2F16
45 71 47

46.  Convert the following decimal numbers to binary: 4310, 14310

101011 10001111

47.  What is the largest numeric value that can be represented with a 4-bit binary number?

15

48.  How many different symbols can be represented with a 4-bit binary number?

16

49.  How many hexadecimal digits are needed to represent 257 different symbols?

3

50.  How many bits are needed to represent one hexadecimal digit (HINT: first, determine how many symbols does one hexadecimal digit represent)? Two hexadecimal digits?

4, 8

Digital Logic

51.  Evaluate the following Boolean function for the inputs A=1, B=1, C=0:
((A OR NOT B) AND (NOT C)) XOR NOT (A AND C)

false

52.  Write the Boolean function for the following expression: “if the car is red or green, and not a Ford, we will buy it” (the car can be both red and green two-tone). Clearly state what each variable means.

A : the car is red

B : the car is green

C : the car is ford


(A OR B) AND (NOT C)

53.  Construct the truth table for your Boolean function.

A / B / C / (A OR B) / NOT C / (A OR B) AND (NOT C)
0 / 0 / 0 / 0 / 1 / 0
0 / 0 / 1 / 0 / 0 / 0
0 / 1 / 0 / 1 / 1 / 1
0 / 1 / 1 / 1 / 0 / 0
1 / 0 / 0 / 1 / 1 / 1
1 / 0 / 1 / 1 / 0 / 0
1 / 1 / 0 / 1 / 1 / 1
1 / 1 / 1 / 1 / 0 / 0

54.  Construct the logic diagram for your Boolean function.

55.  Using your logic diagram, show the value on each line for the case of a car that is a red Ford.