TDT4160: Computers and Digital Design
# Preface
This compendium tries to explain the essence of the course. The information provided is largely based on the course book "Structured Computer Organization" and the lecture slides. Please note that this compendium is written by students, so please be critical to what you read.
Anyone is allowed to edit this compendium, so feel free to make improvements.
# Von Neumann Architecture
Von Neumann architecture
: Computer systems are built up from three types of components: processors, memories, and I/O devices.
CPU (Central Processing Unit)
: The part of the computer that fetches instrucitons one at a time from a memory, decodes them, and executes them.
Memory
: The part of the computer where programs and data are stored.
I/O (Input/output) devices
: The parts of the computer used to transfer information into and out of the processor and main memory.
# Processors
The __CPU (Central Procssing Unit)__ is the "brain of the comptuer. Its function is to execute programs stored in the main memory by fetching their instrucitons, examining them, and then executing them one after another. The components are connected by a __bus__, which is a collection of parallell wires for transmitting address, data, and control signals. Buses can be external to the CPU, connecting it to memory and I/O dvices, but also internal to the CPU.
The CPU is composed of several distinct parts.
The control unit
: Component responsible for fetching insturctions from main memory and determining their type.
The arithmetic logic unit
: Component that performs operations such as addition and Boolean AND needed to carry out the instructions.
The CPU also contains a small, high-speed memory used to store temporary results and certain control information. This memory is made up of a number of registers, each having a certain size and function.
Program counter (PC)
: Points to the next instruction to be fetched for execution.
Instruction Register (IR)
: Holds the instruction currently being executed.
Memory Address Register (MAR)
: Holds the address of the memory location currently being access by the processor.
Memory Buffer/Data Register (MDR)
: Holds the data being transferred to or from the memory location currently being accessed.
Most computers have numerous other registers as well, some of them general purpose as well as some for specific purposes.
# Memory
The memory is the part of the computer where programs and data are stored.
LOAD
: Move data from RAM to registers.
STORE
: Move data from registers to RAM.
MOVE
: Copy data among registers.
ADD
: Add two numbers together.
COMPARE
: Compare one number with another.
JUMP IF CONDITION
: Jump if condition to another address in RAM
JUMP
: Jump to another address in RAM.
OUT
: Output to a device.
IN