You are on page 1of 8

Computing MCQ Test Notes

Microprocessor Basics
CPU = Central Processing Unit / Processor
Memory stores: Data, Instructions
Memory can be viewed as a series of equally-sized location.
Each location has a unique address.
Program Execution Cycle
1. Fetch instruction at PC (Program Counter) address.
2. Decode instruction
3. Execute instruction
Registers - Processors use small fast internal storage to temporarily store
values
 ARM microprocessors have 16 registers labelled R0 – R15.
 R13, R14 and R15 (PC = Program Counter) are special registers.
Machine Code and Assembly Language
Any program is composed of a sequence of machine code instructions which
are stored in memory.
 An Operator performs operations ( * % + - )
 Operands ( e.g. R1, R2, R3, R4)
ALU = Arithmetic-Logic Unit
Register Operand, e.g. R1, R3, R7
Immediate Operand, e.g. #0, #5, #35
LDR = LoaD Register
Binary, Hexadecimal, Bytes and Words
Each memory location is considered as a collection of electronic switches.
Each switch can be either: 0 or 1, on or off, true or false, purple or gold, sitting
or standing.
Bits (Binary Digits) are the fundamental unit of data storage in a computer.
 We read the decimal (base-10) number ‘247’ as 2 = Most Significant Digit
and 7 = Least Significant Digit.
 Binary number system (base-2) is a natural number system for
computing.
 Hexadecimal (base-16) is a convenient numeral system.

1 byte = 8 bits
2 bytes = 16 bits = 1 halfword
4 bytes = 32 bits = 1 word
When referring to memory locations by address we use only units of bytes,
halfwords or words.
Larger units of information storage
- 1 kilobyte (kB) = 2^10 bytes = 1,024 bytes
- 1 megabyte (MB) = 1,024 kB = 2^20 bytes = 1,048,576 bytes
- 1 gigabyte (GB) = 1,024 MB = 2^30 bytes
Data rates
- 1 kilobit (kB) = 1,000 bits
- 1 megabit (Mb) = 1,000 kilobits = 1,000,000 bits
IEC = International Electrotechnical Commission
Representing Text (ASCII)
Alphanumeric symbols = ‘T’,‘h’,‘e’ ‘q’, ‘u’, ‘i’, ‘c’, ‘k’
To store alphanumeric symbols or characters, we can assign each character a
value.
ASCII = American Standard Code for Information Interchange
- 96 of ASCII characters are printable
- Remaining values are control codes

First read digit across horizontal then vertical, e.g. ‘E’ = 0x45
The value 0 is not the same as character ‘0’, i.e. ‘0’ = 0x30
Similarly, this is the case with other characters such as ‘1’, ‘4’ and ‘7’…
Flow Control Cheat Sheet
Flow Control
Flow of execution of a program is sequential
Sequence needs to be combined with selection and iteration
CMP (CoMPare) instruction performs subtraction without storing the result of
the subtraction
Branch Instructions
Using a branch instruction, we can modify the PC value to point to an
instruction of choice
Branch instructions can be:
 Unconditional – always update the PC, i.e. always branch
 Conditional – update the PC only if a certain condition is met, based on
the preceding CoMParison (CMP)
Conditional branch instructions will only branch if some condition is met when
the branch instruction is executed
Flow Control Templates
Binary Arithmetic
Decimal numeral system consists of 10 symbols
 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
If we want to represent 12, we use (1x10^1) + (2x10^0)
This method of expressing a value is known as ‘’positional’’
Binary numeral system consists of 2 symbols
 0&1
If we want to represent 12, we use 1100 or (1 x 2^3) + (1 x 2^2) + (0 x 2^1) + (0
x 2^0).

Examples of Binary Arithmetic Addition


Condition Code Flags
 CPSR = Current Program Status Register
 ‘N’ – Negative
 ‘Z’ – Zero
 ‘C’ – Carry
 ‘V’ – oVerflow
In assembly, we cause the Condition Code Flags to be updated by appending
“S” bit to the instruction mnemonic, (e.g. ADDS, SUBS, MOVS).
ADDS – causes the Condition Code Flags to be updated.
CMP (CoMPare) instruction performs a subtraction without storing the result
of the subtraction.
Processor remembers the properties of the CMP result by updating CCF.
Negative Numbers and 2’s Complement

You might also like