You are on page 1of 29

19CS211

Computer Organisation and


Architecture
Dr V Anantha Narayanan
Von-Neumann & Harvard Architecure
A Processing unit
Von Neumann architecture or
Princeton architecture that contains an
arithmetic logic
unit and processor
registers
A control unit that
contains an
instruction
register and
program counter
Memory that
stores data and
instructions
External mass
storage
Program instructions and data share the Input and output
same memory and pathways. mechanisms
Harvard Architecture
The Harvard
architecture is a
computer
architecture with
separate storage and
signal pathways for
instructions and data.
It contrasts with the
von Neumann
architecture, where
program instructions
and data share the
same memory and
pathways.
ATMega 328 Which Architecture it
belongs to ???
CISC vs RISC
CISC Processor

•It is known as Complex Instruction Set Computer.


•It was first developed by Intel.
•It contains large number of complex instructions.
•In this instructions are not register based.
•Instructions cannot be completed in one machine
cycle.
•Data transfer is from memory to memory.
•Micro programmed control unit is found in CISC.
•Also they have variable instruction formats.
RISC - Reduced Instruction Set Computer
It is a type of microprocessor that has a limited number of
instructions.
They can execute their instructions very fast because
instructions are very small and simple.
RISC chips require fewer transistors which make them
cheaper to design and produce.
In RISC, the instruction set contains simple and basic
instructions from which more complex instruction can be
produced.
Most instructions complete in one cycle, which allows the
processor to handle many instructions at same time.
In this instructions are register based and data transfer
takes place from register to register.
Intel (CISC) believes in hardware bearing
more responsibility, making the coding
simple. I.e. the developers shall be
writing minimal lines of code.
Apple (RISC) believes the other way
round. The philosophy is, hardware has
to be simple and software has to lift
most of the responsibility. Means, the
developers will have a tough job of
writing more lines of code with this
architectural approach
MULT 2:3, 5:2

LOAD A, 2:3
LOAD B, 5:2
PROD A, B
STORE 2:3, A
MULT 2:3, 5:2

RISC
Approach
ARM CPU
LOAD A, 2:3
LOAD B, 5:2
PROD A, B
STORE 2:3, A
Basic Concepts
■Program counter: A register which holds the address of the next
instruction (subsequent instruction) to be executed. This enables faster
execution. Program counter is a register and it cannot be accessed by
the programmer. Or, the programmer does not know the address of
the program counter. It is purposefully hidden from the programmers
view.
■ Stack and Stack Pointer: Stack is a temporary storage area where the
values can be stored. For an instance when a function is called like add
(3,4), the arguments 3,4 would be kept in the stack (the operation is
called pushing) and it is a temporary storage area. Once the function
call is done and result is ready, the result will be again kept on the top
of the stack. Once the execution is complete, the stack can be cleaned
(the operation is referred to as popping). Stack pointer is a register
used to point the stack.
■ Bus: The channel through with the information flows. The data could
be the address or the data from a particular location. If the bus carries
the data, it is called data bus and in case addresses go through the bus,
it is referred as address bus. There are control signals to be sent for
controlling actions and in that case, the bus is referred as control bus
The speed of a computer processor, or CPU, is
determined by the clock cycle, which is the
amount of time between two pulses of an
oscillator. Generally speaking, the higher
number of pulses per second, the faster the
computer processor will be able to process
information. The clock speed is measured in
Hz, typically either megahertz (MHz) or
gigahertz (GHz). For example, a 4GHz
processor performs 4,000,000,000 clock cycles
per second.
The time required by the microprocessor to complete an
operation of accessing memory or input/output devices is
called machine cycle.
One time period of frequency of microprocessor is called t-state.
A t-state is measured from the falling edge of one clock pulse to
the falling edge of the next clock pulse.
Here, Fetch cycle takes four t-states and execution cycle takes
three t-states.
Four steps of Machine cycle
•Fetch - Retrieve an instruction from the memory.
•Decode - Translate the retrieved instruction into a series of
computer commands.
•Execute - Execute the computer commands.
•Store - Send and write the results back in memory.
Instruction Cycle
• The sequence of operations that the CPU has to
carry out for execution of an Instruction is
called instruction cycle.
• 1:- Read an Instruction
• 2:- Decode the instruction
• 3:- Find the address of operand
• 4:- retrieve an operand
• 5:- perform desired operation
• 6:- find the address of destination
• 7:- store the result into the destination
Frequency
Example
Example
Assume machine A has 5MHz Crystal and Machine B has 10 MHz
Crystal

What is the Time of T state in machine B

0.1uS

What is the Time taken by the Instruction MVI A, #35 in Machine


B

0.7uS

Which Machine is having better performance

Machine B is having Better performance compared to Machine A


Summary
Instruction and Execution Cycle

■ A program is nothing but collection of instructions


and all the instructions gets pulled one after another
from the memory (don’t worry which memory we
are talking about, it is just memory).
■ Then, the process of understanding what the
instruction is all about begins.
■ Followed by this, there would be computation and
storing the result.
■ One can simply call this as Fetch, Decode and
Execute, which is more technical as well.
■ But, to establish a better understanding it is needed
to go with a deeper flow.

You might also like