📟 Assembly language
Assembly language uses short mnemonics that map closely to machine code. An instruction has an opcode and an operand. Addressing modes say how to find the operand: immediate, direct, indirect, indexed.
Beneath every Python program is the language the processor really speaks. Here you get as close to the hardware as most programmers ever go.
Assembly language uses short mnemonics that map closely to machine code. An instruction has an opcode and an operand. Addressing modes say how to find the operand: immediate, direct, indirect, indexed.
Logical shifts move bits and fill the gap with zeros: a left shift multiplies by 2, and a right shift divides by 2. A mask tests or changes bits: AND clears, OR sets, XOR flips.
A mnemonic in assembly language is:
In immediate addressing, the operand is:
To clear chosen bits, use a mask with:
To flip chosen bits, use a mask with:
00000110 is shifted left by 1 place.
What denary value results?
Enter an exact answer, without rounding.00001100 is shifted right by 2 places.
What denary value results?
Enter an exact answer, without rounding.An assembler translates:
In indirect addressing, the operand gives:
1100 AND 1010 equals:
1100 OR 1010 equals:
A two-pass assembler builds a:
A simpler circuit is cheaper and faster. Boolean algebra and Karnaugh maps let you shrink logic to its smallest form.
Use the laws to simplify expressions. De Morgan’s laws are especially useful.
In a Karnaugh map, adjacent cells differ by one bit. Group 1s in blocks of 1, 2, 4 or 8, using the largest groups you can. Each group gives one simplified term. Groups may wrap around edges.
A + Ā simplifies to:
NOT(A . B) is equal to:
K-map groups must contain:
A . B + A . B̄ simplifies to:
A half adder has A = 1 and B = 1.
What is its sum output S?
Enter an exact answer, without rounding.A half adder has A = 1 and B = 1.
What is its carry output C?
Enter an exact answer, without rounding.A . 0 equals:
A + 1 equals:
Adjacent K-map cells differ by:
A flip-flop stores:
A full adder has how many inputs?
Good systems plan for things to go wrong: corrupted data, crashed programs and even running one computer inside another.
RISC processors have simple instructions, often run in one cycle, and suit pipelining. CISC processors have complex instructions. A virtual machine is software that behaves like a separate computer, so one host can run several guest operating systems.
Parity and checksums detect errors in transmission. Validation checks data is reasonable. An exception is an error at run time, handled with try/except so that a program does not crash. Parity cannot detect two flipped bits.
RISC processors typically have:
A virtual machine allows:
Parity can fail when:
An exception is handled by:
A byte uses even parity. Seven data bits contain three 1s.
What should the parity bit be?
Enter an exact answer, without rounding.A pipeline has 5 stages, each 1 clock cycle, and is already full.
How many instructions complete in 10 further cycles?
Enter an exact answer, without rounding.Pipelining means:
A checksum is used to:
Which would raise an exception?
A drawback of a virtual machine is:
Handshaking is used in:
Questions from every topic in this course. Pick an answer for each one, then hit Check My Answers.
A logical left shift by 3 multiplies by:
1111 XOR 0101 equals:
NOT(A + B) equals:
Larger groups on a K-map give:
Even parity makes the number of 1s:
CISC processors have: