22-Elec-A4 Digital Systems and Computers · May 2016
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Paper format. National Exams, May 2016 — 07-Elec-A4 Digital Systems & Computers. Three hours, closed book, one approved Casio or Sharp calculator. Six questions, each worth 12 points; five questions constitute a complete exam. A flip-flop excitation table and a list of Boolean identities are printed on the last page. Every one of the six questions is solved below, because the set is intended as a study resource rather than an exam script.
Reference texts. M. Morris Mano & M. D. Ciletti, Digital Design (6th ed.), ch. 3 (map simplification, prime implicants, hazards), ch. 5–6 (sequential logic, counters); J. F. Wakerly, Digital Design: Principles and Practices (5th ed.), §3.7 (three-state outputs), §4.4 (timing hazards and consensus terms), ch. 8 (counters); C. Hamacher, Z. Vranesic, S. Zaky & N. Manjikian, Computer Organization and Embedded Systems (6th ed.), ch. 1–2 (processor structure, registers), ch. 3 (memory-mapped I/O).
Check: segment-to-pin assignment in Question 6. Figure 6.1 shows the buffer chip driving the eight segment lines a…h from Port B pins PB7–PB0, but does not print which pin drives which segment. Throughout Question 6 the conventional weighting a = PB0, b = PB1, …, g = PB6, h = PB7 (decimal point) is assumed and stated explicitly, exactly as the paper's own rubric invites ("the candidate is urged to submit…a clear statement of any assumptions made"). Every bit pattern below is derived from that one assumption; a different pin order permutes the bits but changes no part of the method.
Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.
Given. The question starts from a list of nine candidate items, of which exactly four are the essential components of any stored-program computer, and asks separately about the microprocessor/microcontroller distinction and about four standard CPU register roles.
Find. The four essential components marked from the list; the substantive architectural differences between a general-purpose microprocessor and a microcontroller; and the register associated with each of four described functions.
Approach. Part (a) is settled by asking of each item whether a machine could execute a stored program without it. Parts (b) and (c) are recall questions answered from the standard von Neumann model of processor organisation.
| Item from the list | Essential? | Reason |
|---|---|---|
| Processor (CPU) | X | fetches, decodes and executes instructions; contains the ALU and the registers |
| Memory | X | holds the program and its data — the defining feature of a stored-program machine |
| Busses (address, data, control) | X | the interconnect that carries addresses, data and timing/control between the other blocks |
| I/O ports | X | the interface through which the machine communicates with the outside world |
| Mouse | — | an input peripheral attached through an I/O port |
| Keyboard | — | an input peripheral attached through an I/O port |
| Printer | — | an output peripheral |
| Display monitor | — | an output peripheral |
| Hard drive | — | secondary storage — a block-addressed peripheral, not main memory |
| Aspect | General-purpose microprocessor | Microcontroller |
|---|---|---|
| Integration | CPU only; memory, I/O and timers are separate external chips | CPU, RAM, ROM/Flash, I/O ports, timers and often ADCs on a single die — a “computer on a chip” |
| Buses | address and data buses brought out to pins for external expansion | buses largely internal; pins are devoted to I/O rather than to memory expansion |
| Memory size | large external memory, gigabytes, with cache and virtual memory support | small on-chip memory, typically kilobytes, with no MMU |
| Typical peripherals | none on-chip; provided by a chipset | timers, PWM, ADC, UART, SPI, I²C and interrupt controller on-chip |
| Design objective | maximum throughput and generality; runs an operating system | real-time control, low cost, low power, deterministic response; often bare-metal |
| Bit handling | word-oriented instruction set | bit-level set/clear/test instructions on port pins |
| Application | desktop, server, general computing | embedded control — appliances, instrumentation, automotive, the display driver of Question 6 |
| Description in the question | Register | Function |
|---|---|---|
| the address of the next instruction to be executed | Program Counter (PC), also called the instruction pointer | incremented automatically after each fetch; loaded directly by jumps, branches and subroutine calls |
| the next available location at the top of the stack | Stack Pointer (SP) | adjusted by PUSH/POP and by subroutine call and return, which save and restore the return address |
| pointing to an array or list of data values in memory | Index register (X or Y on a 68HC-family part; a general-purpose pointer register elsewhere) | supports indexed addressing, so a single instruction can be re-used to walk successive elements |
| information used at decision-making points (conditional branches) | Condition Code Register (CCR), also called the status or flags register | holds the N, Z, V and C flags set by the ALU; conditional branch instructions test these bits |
The three parts are more closely linked than they first appear. The four essential components of part (a) are precisely what a microcontroller integrates onto one die in part (b), and the registers of part (c) are the internal state that lets the CPU of part (a) sequence a program at all: the PC drives the fetch, the index register drives data access, the CCR drives control flow, and the SP makes subroutines possible.
| Quantity | Result |
|---|---|
| (a) essential components | Processor (CPU), Memory, Busses (address/data/control), I/O ports |
| (a) not essential | Mouse, Keyboard, Printer, Display monitor, Hard drive (all peripherals) |
| (b) key difference | Microprocessor = CPU alone needing external memory and I/O; microcontroller = CPU + memory + I/O + timers on one chip, for embedded real-time control |
| (c) next instruction address | Program Counter (PC) |
| (c) top of stack | Stack Pointer (SP) |
| (c) pointer to an array/list | Index register (X or Y) |
| (c) conditional-branch information | Condition Code Register (status/flags: N, Z, V, C) |