Basic Computer Organization and Design

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 60

Basic computer

Organization
and Design
Report by:
Adoc, Romeo
Bullo, Rosemarie
Yalung, Nina Mikaela
The general-purpose digital computer is capable
of executing various microoperations and, in
addition, can be instructed as to what specific
sequence of operations it must perform. The user
of a computer can control the process by means
of a program.
Program
A program is a set of
instructions that specify the
operations, operands, and
the sequence by which
processing has to occur.
Instruction Codes
An instruction code is a
group of bits that instruct
the computer to perform a
specific operation.
Instruction Code Format:
Opcode Operand (or Address)

The operation code of an instruction is a group


of bits that define such operations as add,
subtract, multiply, shift, and complement.
n
Size: must consist of at least n bits for a given 2
(or less) to perform distinct operations.
Instruction Code Format:
Opcode Operand (or Address)

Address specifies the register and/or memory


word where the operands are to be found or the
result is to be stored.
Size: must consist of at least n bits to store 2 n
memory words.
Stored Program Organization

n
Addressing Modes
1. Immediate Operand: The instruction
directly provides the data it needs.
2. Direct Address: The instruction
specifies where to find the data in
memory.
3. Indirect Address: The instruction
provides the address of another
memory location, where the actual
address of the data is stored.
Computer Registers
Computer registers are small,
fast storage locations within the CPU
that hold data temporarily during
processing. They serve various
purposes such as storing instructions,
holding data, managing memory
addresses, and facilitating arithmetic
operations.
Common Bus System
In a common bus system, multiple registers and
memory share a set of data lines called a bus. This bus
allows data to be transferred between registers and
memory efficiently. Each register or memory unit can
be connected to the bus, and the control unit decides
which one is active at any given time.

For example, if we want to transfer data from the data


register (DR) to the accumulator (AC), the control unit
selects the DR and the AC on the bus. Then, it enables
the appropriate control signals to initiate the transfer.
Similarly, data from memory can be loaded into
registers or written back to memory using the bus.
Computer Instructions
and Instruction Cycle
Computer Instructions are the commands that a processor
can execute. These instructions are encoded in binary format
and are part of the processor's instruction set architecture
(ISA). The instruction cycle, also known as the fetch-decode-
execute cycle, is the process by which a processor executes
instructions.
3 Divisions of Basic
Computer Instructions

01 02 03
Data movement instructions Arithmetic and logic instructions Control instructions

used to move data between used to perform mathematical used to control the flow of
different parts of the operations (add, subtract, instructions within the
computer system (load, multiply, divide) and logical computer system (branch,
store). operations (AND, OR, NOT) on jump).
data stored in the system.
3 Instruction
Code Formats
1. Memory-Reference Instructions
2. Register-Reference Instructions
3. Input-Output Instructions
Memory- These instructions involve accessing data from or storing
data into memory. They typically use memory addresses to

Reference specify the location of the data. Examples include LOAD (to
load data from memory into a register) and STORE (to store

Instructions
data from a register into memory).
Basic Computer Instructions
Register- These instructions operate on data stored in registers.
Registers are small, fast storage locations within the CPU.

Reference Register-reference instructions often perform arithmetic or


logical operations on data in registers, such as ADD (to add

Instructions
two registers) or AND (to perform a bitwise AND operation
on two registers).
Basic Computer Instructions
Input-Output
These instructions are used to transfer data between the
CPU and external devices, such as keyboards, displays, or
storage devices. Input-output instructions typically involve

Instructions moving data between memory and the device, or between


registers and the device.
Basic Computer Instructions
Phases of Instruction Cycle

Execute the instruction

Decode the instruction

Fetch an instruction
Flowchart
for
Instruction
Cycle
Timing and Control
These are the mechanisms by which the various
components of a computer system are
synchronized and coordinated to perform
operations correctly. Timing refers to the
sequencing of events, while control refers to the
signals and mechanisms used to coordinate those
events.
CLOCK PULSES CONTROL UNIT
plays a crucial role in the timing and control of
a component of the central processing unit (CPU)
operations within a computer system, ensuring
that manages the execution of instructions.
that components operate together harmoniously
and at the correct speed. These pulses serve as a
timing mechanism that synchronizes the
operations of various components within a
computer system.

TIMING SIGNALS SEQUENCE COUNTER


refer to signals that control the timing of a type of counter that generates a sequence of
operations within a computer system. These numbers or states in a specific order. Sequence
signals are generated by a clock oscillator circuit counters are often used in timing and control
and are used to synchronize the operation of circuits to generate timing signals or to control the
various components, ensuring that they perform sequence of operations within a computer system.
their tasks at the correct time and in the correct
sequence.
Control Unit of
Basic Computer
Components of Control Unit:

2 DECODERS

3x8 Decoder
4x16 Decoder

1 SEQUENCE COUNTER

4-bit Sequence Counter

1 CONTROL LOGIC GATE


Example of
Control Timing
Signals
7 MEMORY
REFERENCE
INSTRUCTIONS
AND INSTRUCTION
AND TO AC

This is an instruction that


performs the AND logic operation
on pairs of bits in AC and the
memory word specified by the
effective address. The result of
the operation is transferred to AC.
The effective address will go
through the common bus and
going to AR. After that it will go in
memory. After in memory the
effective address will through
common bus again to DR. After DR,
it will go in ALU and will using AND
operation. And clear SC to 0.
ADD INSTRUCTION
ADD TO AC

This instruction adds the content


of the memory word specified by
the effective address to the value
of AC. The sum is transferred into
AC and the output carry out is
transferred to the E (extended
accumulator) flip-flop.
This is the same process in AND
instruction but we will using ADD
instruction. First is effective
address will enter in common bus
going to AR. After in AR, the
effective address will go through
again in common bus to DR. And
DR going to ALU and will using add
operation and going to AC.
LDA INSTRUCTION
LOAD TO AC
This instruction transfers the
memory word specified by the
effective address to AC.
The value that has fetched in
memory unit from AR will be
transfer to DR. And the value in
data ALU. After ALU, the value will
be load in AC. And clear SC to 0.
STA INSTRUCTION
STORE AC

This instruction stores the


content of AC into the memory
word specified by the effective
address. Since the output of AC is
applied to the bus and the data
input of memory is connected to
the bus.
The value from the AC will be
transfer to AR and it will go
through the memory unit.
BUN INSTRUCTION
Branch Unconditionally

This instruction transfer the


program to the instruction
specified by the effective
address.
int a = 10, b = 5
c=a+b
go to label 3

label 3

IR

AR

PC
int a = 10, b = 5
c=a+b
go to label 3

label 3

IR 0 BUN 40

AR

PC
The line 22 will be called in IR, the
22
PC is 21 and it will be change into
22.
int a = 10, b = 5
c=a+b
go to label 3

label 3

IR 0 BUN 40

AR

PC
The PC will incremented by 1 the
23
result is 22 will become 23.
int a = 10, b = 5
c=a+b
go to label 3

label 3

IR 0 BUN 40

AR 40

PC
The effective address in line 22
23
will be shift in AR
int a = 10, b = 5
c=a+b
go to label 3

label 3

IR 0 BUN 40

AR 40

PC
We will use the equation above if
40
the D4 and T4 is true the value in
AR will be shift into PC.
BSA INSTRUCTION
Branch and Save Return Address

This instruction is useful for


branching to a portion of the
program called subroutine or
procedure.
int a = 10, b = 5,c,
c=a+b
abc( );

abc( )
{
}

The line 22 will be transfer to IR IR 0 BSA 35

and the program counter will be


22.
AR

PC 22
int a = 10, b = 5,c,
c=a+b
abc( );

abc( )
{
}

The address path in IR will be shift


IR 0 BSA 35

in AR which is 35

AR 35

PC 22
int a = 10, b = 5,c,
c=a+b
abc( );

abc( )
{
}

We will use the equation, the PC


IR 0 BSA 35

will get the value of line 35 which


is 23, the PC now is 23.
AR 35

PC 23
int a = 10, b = 5,c,
c=a+b
abc( );

abc( )
{
}

After that the AR will be


IR 0 BSA 35

incremented by 1 as you can see


in the equation.
AR 36

PC 23
int a = 10, b = 5,c,
c=a+b
abc( );

abc( )
{
}

The value of AR will be transfer in


IR 0 BSA 35

PC, and clear SC to 0.

AR 36

PC 36
ISZ INSTRUCTION
Increment and Skip if Zero

This instruction increments the


word specified by the effective
address, and if the incremented
value is equal to 0, PC is
incremented by 1.
IR 0 110 000000001010 10 -1

AR 000000001010
20 0110000000001010
21 1111010000000000
PC 20
22 0111100000000000

We are going to put the line 20 to


IR and shift the address path in
AR. The PC will become 20.
IR 0 110 000000001010 10 0

AR 000000001010
20 0110000000001010
21 1111010000000000
PC 20
22 0111100000000000

As the rule of ISZ instruction, for


example the value in line 10 is -1 it
will be incremented and become 0
IR 0 110 000000001010 10 0

AR 000000001010
20 0110000000001010
21 1111010000000000
PC 20
22 0111100000000000

We are going to skip the line 21 in


PC, instead of 21, we are going to
get the line 22. Because if the
value of line 10 is 0 it will be skip
the next sequence instruction.
INPUT-OUPUT
AND
INTERRUPT
INPUT-OUTPUT
A computer can serve no useful
purpose unless it communicates
with the external environment.
Instructions and data stored in
memory must come from some
input device. Computational
results must be transmitted to
the user through some output
device.
INPUT-OUTPUT
CONFIGURATION
The terminal sends and receives
informaton. Each quantity of information
has eight bits of an alphanumeric code.
The serial information from the keyboard
is shifted into the input register INPR. The
serial information for the printer is
stored in the output register OUTR.
FGO

FGI
PROGRAM
INTERRUPT
The process of communication just
described is referred to as programmed
control transfer.
INSTRUCTION 1

INSTRUCTION 2

INSTRUCTION 3
INTERRUPT HANDLER
.
.
. INSTRUCTION

INSTRUCTION i

INSTRUCTION i +1 INSTRUCTION

.
.
. RETURN FROM INTERRUPT
INTERRUPT
CYCLE
The interrupt cycle is initiated after last
execute phase if the interrupt flip-flop R
is equal to 1. This flip-flop is set to 1 if IEN
= 1 and either FGI or FGO are equal to 1.
Thank
you very
much!

You might also like