2023 S1 IT1020 Lecture 03
2023 S1 IT1020 Lecture 03
2023 S1 IT1020 Lecture 03
LECTURE 3:
COMPUTER ARCHITECTURE
LECTURE CONTENT
Computer organization is
concerned with the way
the hardware components CU
The two status registers have 16 bits and are called the Instruction Pointer
(IP) or Program Counter (PC) and the flag register (F)
IP is the instruction pointer and contains the address of the next
instruction of the program. This is called as Program Counter (PC)
Flag register holds a collection of 16 different conditions. (Ex: result is
zero or not, there is a “carry” etc)
8086 REGISTERS
Segments registers: There are four areas of memory called segments, each
of which are 16 bits and can thus address up to 64KB (from 0000h to
FFFFh).
Code segment (cs register), where the program code is stored.
Data segment (ds register), where data from the program is stored
Stack segment (ss register), where the stack is stored.
Extra segment (es register), a spare segment
All addresses are with reference to the segment registers.
INSTRUCTION CYCLE
All computers provide a mechanism by which other modules (I/O, Memory) may
interrupt the normal processing of the processor
Processor engaged in executing other instructions while slow external devices (ex.
I/O module) become ready and send interrupt request to processor
Processor responds to such interrupt request by running interrupt handler
STATE DIAGRAM OF INSTRUCTION CYCLE WITH INTERRUPT
INSTRUCTION SET ARCHITECTURE (ISA)
Instruction Set is a part of the computer that pertains to internal (or low
level) programming, which is basically machine language.
The instruction set provides commands to the processor.
Instructions instruct (give orders to) the processor what it needs to do.
Consider as “words” in processor’s language.
User codes, normally written in High Level Languages (closer to Natural
Language) must convert to Machine Language to be run on the processor
INSTRUCTION SET ARCHITECTURE (ISA)
Machine
Assembly
Language
Language
How it is
kept in
Memory Memory
Address
INSTRUCTION SET
Sample Instructions
ADD - Add two numbers.
CMP - Compare numbers.
IN - Input from port into AL or AX. Second operand is a port number.
JMP - Unconditional Jump. Transfers control to another part of the program.
JNE - Short Jump if first operand is Not Equal to second operand.
LOAD - Load information from RAM to the CPU.
OUT - Output information to device, e.g. monitor.
STORE - Store information to RAM.
EXECUTION OF INSTRUCTIONS
Processor
Executes
one
instruction
at a time.
EXECUTION OF INSTRUCTIONS
EXECUTION OF INSTRUCTIONS
EXECUTION OF INSTRUCTIONS
EXECUTION OF INSTRUCTIONS
CISC & RISC
CISC:
Primary goal is to complete a task in as few lines of assembly as
possible
Processor hardware complex; Needs less RAM to store the code;
Instruction set is high-level, hence Compiler workload is low
Ex: MULT M1,M2
CISC & RISC
RISC:
Simple instructions that can be executed within one clock cycle
Processor hardware simple; Need more RAM; Instruction set Low-Level, hence
Compiler workload high
Ex: LOAD A, M1
LOAD B, M2
PROD A, B
STORE M1,A
CISC & RISC
CISC RISC
• Includes multi-clock complex • Single-clock, reduced
instructions instruction only
• Emphasis on hardware • Emphasis on hardware
• Memory-to-memory: "LOAD" • Register to register: "LOAD"
and "STORE" incorporated in and "STORE" are independent
instructions instructions
• Small code sizes, high cycles • Low cycles per second, large
per second code sizes
• Transistors used for storing • Spends more transistors on
complex instructions memory registers
CISC & RISC
CISC RISC
• Intel X86 family, AMD • SPARC and Power PC are
processors are heavily used in used in desktop computers and
desktop, laptop and server game consoles
computers • RISC processors are heavily
used in real-time embedded
systems such as mobile
phones, washing machines,
Routers
• Raspberry pi and Arduino
• IoT drives by RISC processors
THANK YOU
31