L T P Class Work: 50
Examination: 100
Total: 150
Syllabus
Unit1: architecture and machines: some definition and terms, interpretation and microprogramming. The instruction set, basic data types, instructions, addressing and memory. Virtual to real mapping. Basic instruction timing. Unit2: time, area and instruction sets: time, cost-area, technology state of the art, the economics of a processor project: A study, instruction sets, professor evaluation matrix Unit-3: cache memory notion: basic notion, cache organization, cache data, adjusting the data for cache organization, write policies, strategies for line replacement at miss time, cache environment, other types of cache. Split I and d-caches, on chip caches, two level caches, write assembly cache, cache references per instruction, technology dependent cache considerations, virtual to real translation, overlapping the Tcycle in V-R translation, studies. Design summary. Unit4: memory system design: the physical memory, models of simple processor memory interaction, processor memory modeling using queuing theory, open, closed and mixed-queue models, waiting time, performance, and buffer size, review and selection of queueing models, processors with cache. Unit5: concurrent processors: vector processors, vector memory, multiple issue machines, comparing vector and multiple issue processors. Shared memory multiprocessors: basic issues, partitioning, synchronization and coherency, type of shared memory multiprocessors, memory coherence in shared memory multiprocessors. Text book: Advance computer architecture by Hwang & Briggs, 1993, TMH Computer Architecture by Michael J. Flynn
Computer Architecture & Organization Computer Architecture: Those attributes of a system which
are visible to a machine language programmer having direct impact on logical execution of a program.These attributes include Instruction set, word size, no of bits used to represent various data types, techniques of addressing memory etc.
Course Objective
The objective of this course is to provide a through discussion of fundamentals of computer organization and architecture. After doing this course you will be able to appreciate the following :The Nature and characteristics of modern day computer systems. Tremendous variety exists from single chip microprocessors to super computers. The various systems differ not only in costs but also in size, performance and applications. Impact of rapid pace of change covering all aspects of computer technology from underlying integrated ckt. Technology to increasing use of parallel organization concepts in combining those components. Certain fundamental concepts that apply to all types of computers. All the basic performance characteristics of computer systems like processor speed, Memory speed, Memory capacity, and interconnection data rate are increasing rapidly but they are increasing at different rates. So designing a balanced system that maximizes the performance and utilization of all elements is a challenge.
Data Movement
Data Storage Control
Data Movement
Control
Data Storage
Data Processing
CPU Controls the operation of computers and performs its data processing functions.
Main Memory Storage of Data I/O Subsystem Data Movement betn. Computer and its external environment. System Interconnection Some mechanism that provides for communication between all the above units.
Main Memory
System Interconnect
CPU
ALU
Registers Set
Control Unit
Control Memory
Cycle: It is the Time between state transitions. If storage registers are being
reconfigured , its called Machine Cycle. If Memory is being reconfigured it is called Memory Cycle.
Machine: The Implementation that interprets the commands and make the
state transitions happen. This Implementation can in turn be Implemented using another machine having its own storage and instruction sets. In such circumstances the outermost machine is called Image (or Micro) Machine and other is called host machine. The set of all Image Commands and Storage is defined as the Architecture of the machine.
The Instruction Decoder (A part of the implementation mechanism) controls the Data Paths (which connects output of one register to input of other registers and vice versa ) consisting of combinational logic. Each OP Code defines which of the various data paths will be used in its Execution. The Collection of all OP codes ( Instruction Set ) define all the Data Paths required by a specific Architecture. The activation of a particular Data Path is done through a Control Point activated and defined for each particular cycle of operation by the Instruction Decoder.
Control Points
OP
Sequence Counter
Decoder
Control Points
Micro MAR
C. P.S .
Direct Decoders
Fast Uses Least area
Ease Of Change
Large/Complex Instruction Somewhat Difficult Easier Sets Support of Operating Systems and Diagnostic Features Very Difficult Easy
Where Used
Instruction set size
The L/S Architecture: The L/S or Load Store architecture specifies that
all operand values must be loaded from Memory into Registers before an execution can take place.
Reg Reg
An ALU ADD instruction must have both Operands and Result specified as Registers ( Three Address Format).
OP
Reg
Mostly used in RISC machines. RISC architecture tries to reduce the amount of complexity in the Instruction Set itself and regularize the instruction format so as to simplify decoding of Instructions.
An ALU ADD instruction one source operand lies in Memory and the other source operand lies in Register which also serves as Destination
Reg
Most general purpose modern mainframe computers like IBM, Hitachi, Fujitsu etc as well as several microprocessors ( Intel X86 Series) follow R/M Style.
Two address Format In an ALU ADD instruction all operand lie in Memory or in Registers or any combination there off.
(One source operand in Register or Memory is also the Destination)
OP
(Three operands
independently specified and each may be a register or Memory
Digital Equipments (DEC) VAX series of machines And Motorola M680X0 series of microprocessors use this architecture.
3. Decimal Digits
4. Characters 5. Bit / Logical
Integers
16 b
S
32b
Integers are the fundamental data types used in computers. Different formats may be used to represent signed numbers all of which involve treating the most significant (left most) bit as sign bit. The number is treated as negative if this bit is 1. Sign Magnitude Representation: This is the simplest form of representation where rightmost n-1 bits in an n bit number represent the magnitude in binary format and left most bit decides if the number is positive or negative.
Integers (Contd..)
Sign-Magnitude Representation has several drawbacks like cumbersome arithmetic and two representations of Zero. Due to These drawbacks this is rarely used to represent integers in computers. The most popular method of Integer Representation is called Twos Compliment representation: Like Sign Magnitude representation, It also uses the most significant bit as sign bit making it easier to see if a number is positive or negative. But rest of the bits in a negative number are used as Twos compliment of the numbers magnitude.
Integers (Contd..)
Twos Compliment Representation is best understood by defining it in terms of a weighted sum of bits. In signed integer n 1 representation the weight of most significant bit is 2 So an n bit integer A can be best represented as
n2 i 0
A 2 an1 2i ai
n 1
so
Positive integer
A 2i ai
i 0
n2
Integers (Contd..)
For a negative number the value of sign bit is one ie a n 1 1
Since its a negative number the sign bit is 1. So value of first term in our equation will be 27 x1 128 The weighted sum of remaining bits is 18. so second term will be +18. Putting these values in the equation we get our integer = -128+18 = -110.
-110 when converted to binary form is 1110 1110 which is twos compliment of 18.
Integers (Contd..)
Advantage of Twos Compliment Representation is that arithmetic can be handled in straight forward manner. To subtract integer B from A we simply require to take the twos compliment ( which can be easily done by inverting all the bits of Integer B and adding 1 to it) of B and ADD it to A. Additions of any two numbers ( Whether positive or negative ) is also straight forward. In some machines Multiply is implemented as Repetitive ADD and Division is implemented as Repetitive Subtract.
To get the two's complement representation for a negative number, take the binary representation for the number's absolute value and then flip all the bits and add 1.
A Sx B
1 Bit
There are various binary representation of Floating Point, the most popular one has following format for a 32 bit word.
8 Bit 23 Bit
Biased Exponent
Significand
The number is stored in a binary word with following three fields. 1. Sign : One bit field indicating positive or negative number
10010011
10100010000000000000000
Decimals
Decimal numbers are stored in two formats. 1. Packed Format: Two Digits per byte Binary Coded Decimals. MSD . LSD SIGN
Length in Bytes Starting Address Binary Coded Decimal Representation 0 0000 1 2 . 0001 0010
9
+ -
1001
1010 1011 in Hex #12 3b
Example: -123 0011 0001 0011 0010 0011 0011 0010 1101 Hex # 31 32 33 2d
Characters
The character strings may be used to represent decimal or text information.
Bits
String of Bits ( Generally limited to word size) are used to represent vectors of single bit elements, which may be tested and changed mostly using logical instructions. The main application of bit strings is communication and control of Input / Output Devices.
Instructions
The Instruction set that defines all actions for all data types is said to have the Orthogonal Property.
Most machines have Instruction sets to perform following common core of operations.
Integer Arithmetic : add, subtract, multiply, divide
Instructions (Contd..)
Some machines use complex instructions to perform certain specific operations and some use combination instructions such as test and branch. Restricting the core processor to commonly used operations results in significant performance improvement in the majority of applications. There is considerable diversity among machines with regard to simple operations also. IBM S/370 uses about 10 ADD instructions , while the VAX machines have more than 25 different forms of ADD instructions. Instruction Mnemonics and Assembly language syntax also vary widely among machines. The convention used to define the destination in arithmetic operations also are different.
Instructions (Contd..)
As per General Machine Conventions, Instruction mnemonics consists of an operation and data type specification concatenated with a .( If there is no explicit data type specification it is assumed that data type is standard machine world.) A similar format is used for branch conditions. In place of the data type specification condition code is specified. Data Type Specifications (OP.Modifiers)
B UB Byte Unsigned Byte H UH half world Unsigned half word
W
F C
word
floating point charcter or decimal
UW
D P
unsigned word
Double precision floating point Decimal in a packed format
Instructions (Contd..)
Branch Conditions
T True LE Less than or Equal
F
V C PE PO
False
Overflow Carry or Borrow Even Parity Odd Parity
LT
EQ NE GE GT
Less Than
Equal Not equal Greater Than or Equal Greater Than
Instructions (Contd..)
Some Common Instructions: ST A, R1 Store the contents of Register R1 in Memory location A
ST.F A, R1 Store the contents of floating register R1 in Location A MOVE A, B Replace the Contents at location A with contents at Location B MOVE.C A, B Move Ch. String starting at B to Location A ZMOVE.P A, B The string length at A is greater, all leading digits to be zeroed.
Instructions (Contd..)
Branch or Jump Instructions: These instructions determine program control flow. Mainly two types BR ( Unconditional Branch) & BC (Conditional Branch)
The BC tests the state of the condition code or CC ( Four Bits That reside in PSW and set by ALU Instructions)
Branch Conventions
BR BC Target (Unconditional branch to instruction contained in target) Target (A conditional branch without a specific condition code)
BC.CC Target ( Same as BC ) BC.NE Target (conditional branch on satisfying the condition specified) BCT.NE R1, Target (A count in R1 is decremented and control goes to target if Result is not equal to zero. Used for Loop Control) BAL & BALR Target / Register (unconditional branch saving current IC in implied register.)
Instructions (Contd..)
Register sets and Addressing Modes
The simplest form of data addressing is accessing Registers. Some Processors use Numbered Registers while others use Named Registers Some instructions use Implied Registers Some Processors define Register 0 ( R0) to have value 0 stored in it.
Register
Memory Indirect Indexed Immediate
RX
ADDR [RX] OFFSET[RX] # Value
Register X
Address specified by ADDR Address specified by contents of RX Address specified by OFFSET plus contents of RX. Load the hexadecimal value.
Instructions (Contd..)
Instruction Code Example: The following code example implements a vector
summation ( For an R/M Architecture). Entry: LD.W R1, xCounter LD.W R2, xBaseAddress LD.W R3, #0 Loop: ADD.W R3, [R2] ADD.W R2, # WordSize SUB.W R1, #1 BC.NE Loop ST.W xSumAddress, R3 :Get x size from memory and load in R1 :Get the base value and load in R2 : Initialize Sum Register to zero : Add the next element : Contents of R2 point to next element : decrement Length counter : If R1 is not zero go to Loop :Write out the Sum
Instructions (Contd..)
System States and Sequencing: Modern Instruction sets tend to collect various pieces of control information into a single word called Program Status Word (PSW) The PSW usually includes both user defined control information and system information pertaining to a particular user. User Defined Control Information Include: Condition Code: defining whether the result of preceding instruction was =0, >0, <0, or Overflow. Current Instruction address Current instruction Length Mask Bits to enable or disable floating point / fixed point /decimal overflow Odd or Even Parity information
Instructions (Contd..)
System Information pertaining to a particular user include: User Id: a pointer to the address regions that belong to this user. Protection Information Supervisor / User State: whether the user program or operating system program is being run Wait / Run state: Machine Check mask enable: Action if an error occurs.
I/O Channel Mask: A particular program may not wish to be interrupted to be notified of an I/O information.
Instructions (Contd..)
Sequencing: Task to Task and Task to Supervisor Three types of events may force program control to move from one module to another.
An Instruction that explicitly calls another module A-trap unusual data condition that implicitly calls for operating system or service module
An Interrupt a concurrently executing process module or an external event that notifies the executing module of an event of mutual interest.
Control must pass from one module to another in an orderly fashion and must return to original module when execution of called module is complete. The Instruction sets provide for instructions like BAL (Branch and Link), the program counter is saved in a designated register and unconditional branch is executed to target defined in the instruction.
Segment
Bytes in Segment
Segment table
Base Bound #ID
CMP
System Address
Cost per bit of storage goes on decreasing and access times goes on increasing as Size of storage grows.
Typically there are three levels in physical memory hierarchy. Cache, Main Memory and Disk and backup storage.
Since faster levels are smaller in size, the memory system uses suitable mechanism to transfer required information from Bigger and slower level to faster levels when it is expected to be accessed by the processor.
This mechanism ( called paging and caching ) managed by hardware manager is transparent even to operating system.
The user ID defines a base register, pointed to by the PSW, which defines the starting point of segment table belonging to this particular user
Most significant or upper 12 bits of users 32 bit virtual address define the segment number. So addition of first 12 bits to 32 bit base address gives an entry in segment table that is contained in memory. This segment table entry contains a base address and a bound for the particular segment identified by the virtual address. Since 32 bit gives 4 GB of Virtual address space, Upper 12 bits give 4096 user segments of 1 MB each.
Segment number (12 bits) Page Number (8 Bits) Byte off set in Page ( 12 Bits)
32 Bit User Virtual address Real memory is divided into page frames which are the same size as the virtual pages ( 4096 Bytes) When a page is needed during the running of a program, it is copied into a page frame in real memory. The process of moving program pages to and from real memory is called paging.
Since there are 4,096 4 K frames in a real memory of 16 M cells, the frame number in our example page table will be 12 bits.
Since the pages and page frames are the same size, the offset from the virtual address can simply be copied into the offset part of the physical address.
User ID
32 Bit
Segment No.
12 Bit
Page No.
8 Bit
Offset in Page
12 Bit
ADDER
Segment Table Entry
TLB
Segment table
Segment Table Base
ADDER
Page Table Entry
Page Table
12 Bit Frame Number
Physical Address
Offset in Frame
Frame Number
16
Page No.
44 34 2 1 0
1011 1011 1011 1010 1010 1011 Physical; Address #BBB AAB
This entry will specify base address for page table #A00111 To get the page table entry (Real Address) #A00111+#10 (Page No.) Frame no contained in this entry (and valid bit Set) #00000BBB The real Address for virtual address #150 10 AAB #BBBAAB
These units are accessed or employed for execution of an instruction . Access to different units occupies one or more cycles. The sequence of events happening in execution of an instruction will determine access to these units and addition of all the cycles required will give the time required to execute the particular instruction.
Instruction Fetch
Generate real address from value stored in PC to access the instruction. Access the cache
END OF UNIT - I