πŸ–ΌοΈChapter 4 cover
Nepal Engineering Council Β· Registration ExaminationACtE Β· Ch 4
← Back to ACtE Syllabus
4

Chapter 4

Computer Organization and Embedded System

ACTE04Β·6 Sub-topicsΒ·60 MCQs
🎯 Read MCQs Mode
4.1

Control and central processing units

ACtE0401
1
The CPU consists of the ALU (Arithmetic and Logic Unit), the Control Unit, registers, and internal buses that connect them.
2
The control unit generates the timing and control signals needed to execute instructions; it can be hardwired (fixed logic circuits β€” fast but hard to modify) or microprogrammed (control signals generated by microinstructions stored in control memory β€” flexible and easy to modify).
3
Control memory is a ROM that stores the microprogram; the Control Address Register (CAR) holds the address of the next microinstruction, while the Control Data Register (CDR) (or pipeline register) holds the current microinstruction being executed.
4
Addressing/sequencing logic determines the next microinstruction address β€” sequential, or a branch/conditional branch based on status bits.
5
A microinstruction format may be horizontal (one bit per control signal β€” wide, but no decoding needed, fast) or vertical (encoded fields need a decoder β€” narrow, but slower).
6
Instruction formats: zero-address (operands taken implicitly from a stack), one-address (one explicit operand, the other implied β€” usually the accumulator), two-address (two explicit operands, result usually overwrites one), three-address (two source operands plus a separate destination operand).
7
Addressing modes: immediate (operand value given directly in the instruction), direct (instruction gives the memory address holding the operand), indirect (instruction gives an address that holds the address of the operand).
8
Addressing modes continued: register (operand held in a CPU register), register indirect (a register holds the address of the operand in memory), indexed/base register (effective address = base/index register value + offset), relative (effective address = program counter (PC) value + offset).
9
RISC uses a small, simple, fixed-length instruction set with mostly single-cycle execution, few addressing modes, and a load/store architecture relying on more registers and compiler optimization.
10
CISC uses a large set of complex, variable-length instructions that may take multiple cycles, supports many addressing modes including memory-to-memory operations, has fewer registers, and does more work in hardware/microcode.
11
Pipelining overlaps the execution stages (fetch, decode, execute, memory access, write-back) of successive instructions to increase instruction throughput, without reducing the time for a single instruction.
12
Pipeline hazards: structural (hardware resource conflict), data (an instruction depends on the result of a previous, not-yet-completed instruction), and control (caused by branch instructions changing the instruction flow).
4.2

Computer arithmetic and memory system

ACtE0402
1
Addition/subtraction in computers is usually performed using 2's complement representation, which allows subtraction to be done as addition of the negated number.
2
Multiplication can be performed by repeated addition and shifting; Booth's algorithm speeds this up by handling strings of 1s and 0s efficiently, working correctly for both signed and unsigned numbers.
3
Division is performed by repeated subtraction and shifting, using restoring or non-restoring division algorithms.
4
Logical operations (AND, OR, XOR, NOT) and shift operations (logical shift, arithmetic shift, rotate) are performed by the ALU on binary data.
5
The memory hierarchy arranges storage by speed, cost, and capacity: CPU registers (fastest, smallest, most expensive) β†’ cache memory β†’ main memory (RAM) β†’ secondary storage (disk, SSD β€” slowest, largest, cheapest).
6
Internal memory refers to semiconductor memory directly addressable by the CPU (RAM, ROM, cache); external memory refers to secondary storage devices (hard disk, magnetic tape, optical disks).
7
Cache memory works on the principle of locality of reference: temporal locality (recently used data is likely to be used again soon) and spatial locality (data near recently used data is likely to be used soon).
8
Cache size: larger caches improve hit rate but increase cost and access time.
9
Mapping function: direct mapping (each block maps to exactly one cache line), fully associative (a block can go anywhere), set-associative (a compromise β€” a block maps to a specific set of lines).
10
Replacement algorithm: LRU (Least Recently Used), FIFO (First-In-First-Out), LFU (Least Frequently Used), Random β€” used when a new block must replace an existing one, needed for associative/set-associative mapping.
11
Write policy: write-through (writes go to cache and main memory simultaneously β€” simple, more traffic) vs write-back (writes go to cache only; main memory updated later when the block is replaced β€” less traffic, more complex).
12
Modern systems commonly use multiple cache levels: L1 (fastest, smallest, per-core), L2, and L3 (larger, shared, slower).
13
RAM (Random Access Memory) is volatile and both readable and writable; it loses data on power loss. ROM (Read-Only Memory) is non-volatile and normally only readable after manufacture.
14
PROM (Programmable ROM) can be written once by the user; EPROM is erased using UV light then reprogrammed; EEPROM/Flash are electrically erasable and reprogrammable, non-volatile.
4.3

Input-Output organization and multiprocessor

ACtE0403
1
Peripheral devices include input devices (keyboard, mouse), output devices (monitor, printer), and storage devices (disk drives).
2
An I/O module (interface) connects peripherals to the system bus, handling control & timing, and communicating with both the CPU and the device.
3
I/O module functions also include data buffering and error detection.
4
Programmed I/O: the CPU continuously polls the device status (busy-waiting) and transfers data itself β€” simple but wastes CPU time.
5
Interrupt-driven I/O: the device interrupts the CPU when it is ready, so the CPU can perform other work while waiting β€” more efficient than polling.
6
Direct Memory Access (DMA): a dedicated DMA controller transfers data directly between the device and main memory without CPU involvement in the actual transfer.
7
The CPU only initiates a DMA transfer and is notified on completion β€” DMA is fastest for bulk transfers.
8
A multiprocessor system has two or more CPUs that can execute instructions simultaneously, increasing overall system performance.
9
Tightly coupled multiprocessors share a common main memory (shared-memory systems).
10
Loosely coupled multiprocessors have their own local memory and communicate via message passing (distributed systems).
11
Interconnection structures link processors, memory, and I/O: common bus, crossbar switch, multistage interconnection network, and hypercube topologies β€” each trades off cost against bandwidth/scalability.
12
Inter-processor synchronization in tightly coupled systems uses shared memory with primitives (semaphores, locks/mutexes); loosely coupled systems use message passing.
4.4

Hardware-Software design issues on embedded system

ACtE0404
1
An embedded system is a combination of hardware and software designed to perform a specific, dedicated function within a larger system (e.g., a washing machine controller, an automotive ECU).
2
Classification by scale/complexity: small-scale (single 8/16-bit microcontroller), medium-scale, and large-scale (32/64-bit processors, complex OS) embedded systems.
3
Classification by functional requirement: hard real-time (missing a deadline is a failure), soft real-time (occasional missed deadlines are tolerable), standalone systems, networked/communication systems, and mobile embedded systems.
4
General-Purpose Processor (GPP): programmable for any task; flexible but less efficient for one specific function.
5
Single-Purpose Processor: custom-designed hardware (e.g., an ASIC) that executes exactly one function β€” fast, low power, but inflexible and costly to change.
6
Application-Specific Instruction-set Processor (ASIP): a processor with an instruction set customized/optimized for a particular application domain (e.g., DSPs, network processors) β€” a middle ground between GPP and single-purpose.
7
A custom single-purpose processor is built from a datapath (registers, ALU, muxes β€” performs the actual operations) controlled by a controller (a finite state machine, FSM, that sequences the datapath operations).
8
Design flow: capture the desired behavior β†’ translate it into a datapath + FSM controller β†’ optimize the design.
9
Optimizing a custom processor targets area, performance, and power β€” e.g., by sharing hardware resources, reducing the number of states/cycles, or minimizing switching activity.
10
Basic architecture/operation: for a programmable processor, operation follows the classic fetch – decode – execute cycle, viewed by the programmer through its instruction set (the "programmer's view").
11
A typical embedded development environment includes a cross-compiler, assembler, linker, debugger, and simulator, since code is developed on one machine (host) and runs on another (target).
4.5

Real-Time operating and control system

ACtE0405
1
A process is an independent program in execution with its own memory space; a thread is a lightweight unit of execution within a process, sharing the process's memory with other threads.
2
Multiprocessing means multiple CPUs execute processes simultaneously; multitasking means multiple tasks/processes appear to run concurrently on a single (or few) CPU(s) through fast time-sharing.
3
A task in an RTOS is a schedulable unit of work, similar to a process/thread, that the scheduler assigns CPU time to.
4
FCFS (First-Come-First-Served): tasks are executed in the order they arrive; simple but can cause long waits.
5
Round Robin: each task gets a fixed time slice (quantum) in rotation; fair, good for time-sharing.
6
Priority-based scheduling: higher-priority tasks are executed before lower-priority ones.
7
Rate Monotonic Scheduling (RMS): a fixed-priority algorithm for periodic tasks β€” shorter period gets higher priority; common in hard real-time systems.
8
Earliest Deadline First (EDF): a dynamic-priority algorithm β€” the task with the nearest deadline runs first; optimal for uniprocessor scheduling.
9
Task synchronization mechanisms β€” semaphores, mutexes, message passing β€” coordinate access to shared resources and prevent race conditions between concurrent tasks.
10
A device driver is a software module that provides a standard interface allowing the operating system and applications to communicate with hardware peripherals.
11
Open-loop control: output is not measured or fed back; no correction for disturbances/errors; simple and cheaper (e.g., a basic toaster timer).
12
Closed-loop (feedback) control: output is measured and fed back for comparison; automatically corrects for disturbances/errors; more complex and accurate (e.g., a thermostat-controlled heater).
4.6

Hardware descripts language and IC technology

ACtE0406
1
VHDL (VHSIC Hardware Description Language) is a language used to describe the structure and behavior of digital circuits, for both simulation and synthesis into actual hardware.
2
A VHDL design has two main parts: the entity (declares the circuit's input/output interface β€” the "black box" ports) and the architecture (describes the internal behavior or structure).
3
Modeling styles: behavioral (describes what the circuit does, using processes), structural/dataflow (describes the circuit as interconnected components/signal assignments), and mixed (a combination of both).
4
Common VHDL data types include bit, bit_vector, std_logic, std_logic_vector, integer, and boolean.
5
VHDL can represent both signed and unsigned binary data; arithmetic operations on signed data must check for overflow when the result exceeds the representable range.
6
Combinational logic in VHDL is described using concurrent signal assignment statements or a process with a sensitivity list that reacts to any input change (no clock involved).
7
Sequential logic in VHDL is described using a process with a clock signal in its sensitivity list, typically using a construct like if rising_edge(clk) then ... so outputs change only at clock edges.
8
Pipelining in VHDL is implemented by inserting clocked registers between combinational logic stages, so each stage's result is latched before feeding the next stage β€” increasing throughput just like hardware pipelining.
9
Integration levels: SSI (tens of transistors/gates, e.g., basic logic gates), MSI (hundreds, e.g., counters, multiplexers), LSI (thousands, e.g., simple processors, memory chips).
10
Integration levels continued: VLSI (hundreds of thousands to millions of transistors, e.g., modern microprocessors), ULSI (tens of millions+ transistors on a single chip).
11
CMOS (Complementary Metal-Oxide-Semiconductor) is the dominant fabrication technology for modern digital ICs due to its very low static power consumption.