Lecture11_new
Lecture11_new
Lecture11_new
Prepared by
Dr. Manju Mathew
1
Lecture Objectives
• Summarize the topics covered so far
• Introduce Instruction Set Architecture (ISA)
2
Computer system analysis
• General purpose computers are modified versions of Von Neumann machine
• All computers follow almost similar basic structure
– CPU (ALU, Registers and CU)
– Memory System ( primary and secondary)
– I/O units
– Bus for interconnection
3
Organization and Architecture
• Architecture involves the design of instructions and datatypes and is considered as high level
design
• Organization involves design and selection of hardware components and is the low level
design
4
Computer Registers
• Special Purpose Registers
– Located in the processor for specific purpose
– Takes part in the execution of an instruction
– Program Counter, Instruction Register, Address Register, Data Register
– Accumulator or processor register
– No direct access for the user
5
Microoperations
• Data transfer operations
– Register transfer (MOV B,A)
– Memory transfer ( MOV M,A)
• Arithmetic operations
– Addition, subtraction, Incrementer, Decrementer ( ADD, SUB, INR, DCR)
• Logic operations
– NOT, OR, Ex-OR, AND (CMA, ORA, XRA , ANI)
• Shift operations
– Arithmetic shift
– Logical shift
– Circular shift
7
Program and Instruction
• Program
– A set of related statements written in any high level language to
accomplish a specific task ( simple or complex)
• Program statement
– Single line of code within a program
– corresponds to a few number of microoperations
– Computer identifies the microoperations by compiling the program
• Instruction
– Single line of assembly language code indicating one or two micro operation
– The binary equivalent of the assembly code is termed as machine instruction
(object code)
– Computer executes machine instructions in the specified order 8
C Program Example
#include<stdio.h> To include the i/o library
Note: there can be instructions without operand part but only opcode
11
Opcode
Decoding of these bits are done by the control unit of the processor
Number of bits in the opcode plays a key role in the formulation of maximum possible
instructions in the instruction set of a specific processor
12
Operands
• Specifies the data or address required for the operation
Source reference 13
Classification of Instructions
I. Data Transfer Instructions
14
Instruction Cycle
– Time taken to complete the execution of one machine instruction
– Instruction Execution
• Register read/ memory read
• Arithmetic/Logic/Shift operations
• Register write/memory write
15
Instruction
Memory
00111110
01010001
Decoder
PC
IR
MAR
Opcode bits are transferred to the control unit for generating necessary control signals
17
Instruction Set Architecture (ISA)
• Computer Architecture is often termed as ISA
• Examples of CISC
– Motorola 68000
– IBM 370
– Intel processors
• Examples of RISC
– MIPS - used in automotives
– ARM – used in mobile phones
19
CISC instruction example
• Consider the C program statement
c=a+b;
20
CISC Features
1. Instruction length is not limited to one word of the memory
21
RISC approach
• Architecture evolved in late 1970s
• Key points in RISC approach are
– Limit the length of each machine instruction to one word in memory
– To limit the length of arithmetic and logic instructions, both operands are either
stored in registers or one operand would be provided as part of the instruction
– Load/Store architecture for memory access
c=a+b;
Load R1, A
Load R2, B
add R3, R1,R2
Store R3, C
In RISC processors, machine instructions does not resemble the high level instruction
23
RISC Features
1. Instruction length is limited to one word of the memory
24
Load /Store
• Load This keyword implies transferring data from main memory to any
specific register within CPU
• In 8085, the assembly code is of the form LDA address1
( Load the accumulator with the content of a memory location specified by
address1)
• Store This keyword implies transferring data to main memory from any
specific register within CPU
• In 8085, the assembly code is of the form STA address2
To execute these type of instructions, each memory location must have
unique physical address ( possible with semiconductor memory technology)
25
Registers
Core
Memory hierarchy
• Based on location, size, speed and cost L1 Core
Cache
27
Main Memory locations and addresses
28
DRAM Memory Technology
• Very simple and cheap but slow
• One capacitor and one transistor for each cell
• To write data, word line =1 , T gets on
• For writing 1, Bit line =1 ( Vss =3.3V)
• Capacitor charges through T towards 3.3V
• Capacitor keeps the charge even after the word line is turned off
• Presence of charge = 1
• Absence of charge = 0
29
Bit, byte and word
Bit – 0 or 1
Byte – group of 8 bits
Word – normally group of 4 bytes ( 2 bytes – halfword , 8 bytes - double
word)
Memory can be accessed byte by byte
Successive addresses refer to successive byte locations in memory
Terminology used is byte addressable memory
32 bit computer have 4 byte locations in each word row Byte
b3 b0
1
30
Byte Addressing
• Two ways of addressing
– Little endian
– Big endian
31