Computer_Organization_Study_Guide
Computer_Organization_Study_Guide
Logic Circuits
The basic logic gates can be summarized as follows (for IB, the gates can be drawn as a
circle with the name of the gate inside).
A NOT A A B A NAND B
0 1 0 0 1
0 1 1
1 0
1 0 1
A B A AND B
1 1 0
0 0 0
A B A NOR B
0 1 0
0 0 1
1 0 0
0 1 0
1 1 1
1 0 0
A B A OR B
1 1 0
0 0 0
A B A XNOR B
0 1 1
0 0 1
1 0 1
0 1 0
1 1 1
1 0 0
A B A XOR B
1 1 1
0 0 0
0 1 1
1 0 1
1 1 0
Gates can be combined to form compound logic circuits. If we interpret input signals as
truth values of propositions, we can thus model compound statements about the
propositions using circuits.







In order to be useful, a computer needs to contain circuits that can store data, perform
operations, and move data from one storage circuit to another.
Storing Data
A flip-flop circuit can store 1 bit of data. It has set (S) and reset (R) inputs, which
respectively switch the bit on and off. Since there is a feedback loop in the circuit, the
previous value of the output also acts as an input signal, which maintains the state over
time. An example of a basic flip-flop circuit follows.
To store more than a bit of data, we can treat multiple flip-flops as a single unit called a
register. For example, a “nibble”, or 4-bit register, can store 16 distinct values.

Performing Operations
Some circuits are designed to perform operations. For example, a full adder adds two bits
and keeps track of the carry bit.
Data can be moved from one storage circuit to another using a multiplexor which selects
the source of data to be written to a given destination. For example, the following circuit
copies a bit to destination D; whether the bit copied is from source A or B is determined
by selector S.
In general, there are many more than two potential sources, and the selector is a register
with enough bits to distinguish the sources.
Similarly, a demultiplexor uses a selector to choose the destination for a given source.

Computer Organization
The CPU is the “brain” of the computer, responsible for executing instructions and
managing data flow in the system. It consists of:
The ALU contains the hardwired circuits that perform arithmetic (such as addition
and subtraction), bitwise logical (such as bitwise AND, OR, NOT) operations, bit-
shifting and other operations essential for processing data.
The CU coordinates the operation of the CPU by moving data between components
and decoding the instructions fetched by the CPU. Two key registers in the CU are
the program counter (PC), which stores the address in memory of the next
instruction to be executed, and the current instruction register (CIR or IR), which
stores the actual instruction.
Two key registers within the CPU are the memory address register (MAR) and the
memory data register (MDR), which facilitate store (writing data to the memory) and
load (reading data from the memory) instructions. The MAR stores an address in memory
from which data is to be loaded from or where data is to be stored, and the MDR holds the
actual data that is to be stored to memory or acts as the destination for data that is to be
loaded from memory. The MAR is connected to the memory through a unidirectional bus
called the memory address bus, and the MDR is connected through a bidirectional bus
called the memory data bus.
The Machine Instruction Cycle
The computer operates by repeatedly going through the machine instruction cycle,
which can be simpli ed as the following steps.
1. Fetch
2. Decode
3. Execute
(i) Data determined by the instruction argument sent as input to the instruction
circuit in the ALU determined by the opcode.
(ii) The output generated by the instruction circuit is copied to the destination
determined by the instruction opcode or argument.
Primary Memory
• Random access memory (RAM) is volatile memory (data is lost when power is off)
used to store data and instructions currently being used by the computer. Both read
and write operations can be performed on the RAM.
• Read-only memory (ROM) is non-volatile memory (data is retained even when power
is off) that is used to store rmware (programs implemented directly as circuits) such
as a basic input-output system (BIOS), which contains instructions for starting up the
computer. Data can only be read from ROM, not written to ROM.
fi
fi
fi
Cache memory is a small, high-speed memory located inside or near the CPU, used to
temporarily store frequently accessed data and instructions. It speeds up system
performance by reducing the time needed to access data from RAM. When the CPU needs
data, it rst checks the cache; if the data sought is not in the cache (a “cache miss”), it
fetches the data (and nearby data) from RAM and stores it in the cache for future access.
Secondary Memory
Secondary memory consists of persistent storage devices such as hard drives, flash
drives and CD-ROM, which retain data even after the computer is turned off. It is used for
long-term storage of les, programs, and system data. Without persistent storage, all data
would be lost when power is disconnected.
Software