Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
0 views

Computer_Organization_Study_Guide

Uploaded by

Danny Zhang
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Computer_Organization_Study_Guide

Uploaded by

Danny Zhang
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Computer Organization

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.

Full adders can be grouped to perform addition on registers.

Calculations that are commonly performed by circuits in computers include arithmetic


calculations (such as those performed by full adders), bitwise logic operations (such as
bitwise OR, AND and NOT operations), and bit shifting (such as shifting all bits left or right
in a register).

Moving Data

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.

A multiplexor can be “black-boxed” as follows.

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 Central Processing Unit (CPU)

The CPU is the “brain” of the computer, responsible for executing instructions and
managing data flow in the system. It consists of:

1. Arithmetic Logic Unit (ALU)

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.

2. Control Unit (CU)

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.

3. General purpose registers

General purpose registers (sometimes called accumulators) are small, high-speed


storage locations inside the CPU used for temporarily holding data and instruction
results. (If there is only one general purpose register, it is called the accumulator.)

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

(i) The address in the PC is copied to the MAR.


(ii) The instruction at that memory address is loaded to the MDR.
(iii) The instruction in the MDR is copied to the CIR.

2. Decode

(i) The instruction in the CIR is interpreted as an opcode and arguments.


(ii) The opcode is used to determine which circuit in the ALU is to be used.
(iii) The argument is used to determine opcode speci c data, such as which
registers are involved in the instruction.

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

There are two types of primary memory in a computer:

• 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

An operating system (OS) manages is software that acts as an interface between


software and the underlying machine hardware. Its functions include:

• To allocates and deallocate memory to programs.


• To manages multitasking by running several programs simultaneously.
• To provides a structure for storing and accessing les through a le system.

Application software is software created to perform speci c tasks on operating systems.


Examples include word processors (e.g. Word), spreadsheets (e.g. Excel), database
management systems (e.g. MySQL) and web browsers (e.g. Chrome).
fi
fi
fi
fi
fi

You might also like