CAPE Computer Science Paper 1 Flashcards
(57 cards)
What is the largest integer that can be represented in 4-bit signed magnitude?
7
What is the 4-bit two’s complement of 8?
Invalid - 8 cannot be represented in 4-bit two’s complement.
What is the 8-bit sign-and-magnitude representation of -29?
10011101
What type of computer system is used for weather forecasting?
Supercomputers
The range of instructions a CPU can execute is called the:
Instruction set
What stores permanent binary information?
ROM
What component handles “if x < 0”?
ALU
What component coordinates saving a file?
Control Unit (CU)
What is flash memory?
EEPROM
Which memory component is the fastest?
Registers
Flip-flops are:
Two-state devices; registers are made from them.
Popular scheme for representing characters?
ASCII
Which logic gate statements are FALSE?
I and II only (NOT gate doesn’t have more than one input)
Correct C code to read a double num
:
scanf(“%lf”, &num);
Data type best for storing currency:
Double
Invalid variable name:
2ndmark
Tool to combine compiled modules into an executable:
Linker
Tool translating one line at a time:
Interpreter
Tool translating high-level to machine code all at once:
Compiler
Purpose of fetch in fetch-decode-execute cycle:
Obtaining an instruction from memory
What is the value of a
after for(i=1;i<5;i++) a *= i;
?
24
What error is present if a leap year isn’t accounted for?
Logic error
Which control structure reads unknown number of file records?
Sentinel control loop
Statement to output an integer x
to file pointer fp
:
fprintf(fp, “%d”, x);