Computer Organisation and Architecture Unit I .pdf

202402100002 65 views 177 slides Oct 10, 2024
Slide 1
Slide 1 of 186
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94
Slide 95
95
Slide 96
96
Slide 97
97
Slide 98
98
Slide 99
99
Slide 100
100
Slide 101
101
Slide 102
102
Slide 103
103
Slide 104
104
Slide 105
105
Slide 106
106
Slide 107
107
Slide 108
108
Slide 109
109
Slide 110
110
Slide 111
111
Slide 112
112
Slide 113
113
Slide 114
114
Slide 115
115
Slide 116
116
Slide 117
117
Slide 118
118
Slide 119
119
Slide 120
120
Slide 121
121
Slide 122
122
Slide 123
123
Slide 124
124
Slide 125
125
Slide 126
126
Slide 127
127
Slide 128
128
Slide 129
129
Slide 130
130
Slide 131
131
Slide 132
132
Slide 133
133
Slide 134
134
Slide 135
135
Slide 136
136
Slide 137
137
Slide 138
138
Slide 139
139
Slide 140
140
Slide 141
141
Slide 142
142
Slide 143
143
Slide 144
144
Slide 145
145
Slide 146
146
Slide 147
147
Slide 148
148
Slide 149
149
Slide 150
150
Slide 151
151
Slide 152
152
Slide 153
153
Slide 154
154
Slide 155
155
Slide 156
156
Slide 157
157
Slide 158
158
Slide 159
159
Slide 160
160
Slide 161
161
Slide 162
162
Slide 163
163
Slide 164
164
Slide 165
165
Slide 166
166
Slide 167
167
Slide 168
168
Slide 169
169
Slide 170
170
Slide 171
171
Slide 172
172
Slide 173
173
Slide 174
174
Slide 175
175
Slide 176
176
Slide 177
177
Slide 178
178
Slide 179
179
Slide 180
180
Slide 181
181
Slide 182
182
Slide 183
183
Slide 184
184
Slide 185
185
Slide 186
186

About This Presentation

Computer Organisation and Architecture


Slide Content

Computer Organization and
Architecture
COURSE CODE
CS229(SY-CE/IT)

WhytoStudyComputerOrganization&Architecturecourse?
Studentswilluseknowledgeofiteverydayandfortherestoflifeaswell.
AsCOAisperhapsthemostfundamentalsubjectincomputerscience.
Knowingwhat'sinsidecomputerandhowitworkswillhelpstudentstodesign
anddevelopnewsystem.
Itwillhelpstudentstoimplementapplicationsinbetter,faster,cheaper,more
efficientandeasierway.
COAfocusesondesignofvariouscomponentsnecessarytoprocess
informationdigitallye.g.memory,ALU,CU,IOdevicesetc.

ThestudyofCOAfocusesontheinterfacebetweenhardwareandsoftware.
COAcourseisimportantintheGATEexaminationpointofview.(5-11
marks/100).
BecauseofthesereasonsCOA/COcourseisincorporatedineveryuniversity
syllabusasacompulsory&coresubject.

Comparison between old COA and new COA syllabus
Lab component is newly introduced with this course.
Old Digital Electronics and Microprocessor course and one unit of ACA from
old TY COA are removed.
This course is combination of three courses that is DEM, CO & ACA/HPC
Nearly 35% syllabus of old COA is changed

TEACHING SCHEME : EVALUATION SCHEME :
LECTURE PRACTICAL
THEORY
PRACTICAL
PRESENTATION/
DEMONSTRATION
TOTAL
MSE ESE IA
3 2 35 35 30 50 - 150
PRE-REQUISITE:
1.EX102-Electrical & Electronics Engineering

COURSE OBJECTIVES:
CS.CEO.1:TounderstandtheArchitectureof80386.
CS.CEO.2:TogetfamiliarwithAssemblylanguageprogramming.
CS.CEO.3:TounderstandtheInputOutputorganizationand
controlunitofcomputersystem
CS.CEO.4:Togetfamiliarwiththememoryorganizationofthe
computersystem
CS.CEO.5:Tolearnworkingofarithmeticunitofthecomputer
system.
CS.CEO.6:Todifferentiatevariousorganizationsforhigh
performancecomputing

COURSEOUTCOMES:
Studentssuccessfullycompletingthecoursewillbeableto
CS.CO.1:Explainthearchitectureofthe80386processor.
CSCO.2:Designandwriteassemblylanguageprogramsfor
differenttasks.
3CS.CO.3:IllustrateIOorganizationsandcontrolunit.
CS.CO.4:Analyzevariousmemoryorganizationtechniquessuchas
Segmentation,Paginginthecomputersystem.
CS.CO.5:Illustratearithmeticoperations.
CS.CO.6:Comparevariousparallelprocessingarchitecturesand
environments

THEORY:
Architecture of 80386 Processor 6 Hours
App/System/Casestudy:
Pentiumprocessors
Contents:
80386Architecture,Featuresof80386,Registers,GlobalDescriptor
Table,LocalDescriptorTable,InterruptDescriptorTable,DataTypes,
80386addressingmodes,CISC,RISC.Intelcorei9processor
Selfstudy:Pentiumprocessorarchitecture
FurtherReading:Intelcorei9processorarchitecture

Unit IIInput/output organization and Control unit 6 Hours
App/System/Casestudy:
Input/outputDevices
Contents:
Input-OutputOrganization:AccessingI/Odevices,Interrupts,direct
memoryaccess.Buses.StandardIOinterfaces,PCI,SCSI.
ControlUnit-Basicconcepts,Microprogrammed control,Hardwired
control,Pipelinecontrol.
SelfStudy:InterfaceCircuits.
Furtherreading:USB.

Unit IIIThe Memory System 5 Hours
App/System/Casestudy:
Memoryhierarchy
Contents:
Basicconcepts,semiconductorRAMmemories,read-only
memories,speed,sizeandcost,cachememories,DRAM,
SRAM,RAID,virtualmemory.SSD.
SelfStudy:Secondarystorage
Furtherreading:Flashmemory

Unit IVSegmentation,Pagingand Multitasking 9 Hours
App/System/Casestudy:
MMUini7Processor
Contents:
Segmentation–Introduction,supportregisters,relatedinstructions,descriptors,
memorymanagement throughsegmentation,logicaltolinearaddress
translations,protectionbysegmentation,privilege-level,protectionrelated
instructions,inter-privilegelevel,transfercontrol,Paging-supportregisters,related
datastructures,lineartophysicaladdresstranslation,TLB,pagelevel
protection.
Multitasking-supportregisters,relateddatastructures,Taskswitching,Nested
task.
SelfStudy:Protectedmodeinstructions
Furtherreading:SegmentationandPaginginPentiumProcessor

Unit VArithmetic Operations 6 Hours
App/System/Casestudy:
Binaryrepresentationofprogram
Contents:
DesignofFastAdders,Additionofpositivenumbers,Additionand
SubtractionofSignedNumbers,MultiplicationofPositiveNumbers,
SignedOperandMultiplication,FastMultiplication,Floating-point
NumbersandOperations.
SelfStudy:Integerdivision
Furtherreading:Floatingpointprocessorarchitecture.

Unit VIPipelining 6 Hours
App/System/Casestudy:
UltraSPARCIIArchitecture
Contents:
Flynn'sClassification,BasicConcepts,DataHazards,Instruction
hazards,influenceoninstructionsets,datapathandcontrol
considerations,Superscalar,Performanceconsiderations,SIMD
GPUarchitecture.
SelfStudy:SMPArchitecture
Furtherreading:CC-NUMAArchitecture.

TEXT BOOK:
1.DouglasV.Hall,“MicroprocessorsandInterfacingProgrammingandHardware”,
8086.80286.80386.80486,SecondEdition,TataMcGrawHil
2.Intel80386Programmer'sReferenceManual1986,IntelCorporation,Orderno.:
231630-011,December1995.
3.BarryB.Brey,“TheIntelMicroprocessors:8086/8088,80186/80188,80286,80386,
80486,Pentium, PentiumproProcessor,PentiumII,PentiumIII,Pentium4,and
Core2...-Architecture,Programming,andInterfacing”.
4.W.Stallings,“ComputerOrganizationandArchitecture:Designingfor
performance”,PearsonEducation/PrenticeHallofIndia,2003,ISBN978-93-325-
1870-4,7thEdition.
5.ZakyS,Hamacher,“ComputerOrganization”,5thEdition,McGraw-Hill
Publications,2001,ISBN-978-1-25-900537-5,5thEdition.

REFERENCES:
1.M Morris Mano “Digital Logic and Computer Design” 1/e
Pearson, June 2016.
2.Kauffmann, “Computer System Architecture” by M. Mano, 2001,
Prentice-Hall ISBN 72157661505664197
3.John P Hays, “Computer Architecture and Organization”,
McGraw-Hill Publication, 1998, ISBN:9781259028564, 3rd Edition.

Type Examination Syllabus Marks Total Marks
MSE
Unit No. 1,2
& 3
35
ESE
Unit No. 1 to
6
35
Internal
Assessment
Unit No. 1 to
6
60
Continuous
Assessment
Practical
List
80 (10
marks per
practical
title)
End Sem
Assessment
Practical
List
40
Written exam /Online
examination
Activity, Assignments,
Quiz, Presentations etc.
Written exam /Online
examination
100
EXAMINATION SCHEME
Practical Exam/
Demonstration/ Report/
Review
Writing
Practical
performance
35
30
15
35
Mode of Assessment
Weightage in
Final Score
35
50
Practical
(CS229L)
Theory
(CS229)

Sr. No.
Course
Objective
Type of
Assessment
LMS/
Tools
Used
Tentative
Date of
Conduction
Activity 1
CO1 &
CO2
Online Collpoll
Activity 2 CO3 Online Collpoll
Activity 3 CO4 Online Collpoll
Activity 4 CO4 Online Collpoll
Activity 5 CO5 Online Collpoll
Activity 6 CO6 Online Collpoll
10/2/2021
24/3/2021
12/4/2021
28/4/2021
13/1/2021
1/2/2021
10
10
10
10
INTERNAL ASSESSMENT DETAILS
Name
Theory Assignment & Poster
making with presentaion
Theory Assignments
Quiz
Theory Assignments
Quiz
Marks
10
10
Quiz Moodle
/
Socrative
/

Non graded activities
Guest lectures
Flipped classroom, Jigsaw activities
Field visit
Computer assembling and maintenance workshop

Historical perspective of computer system
First Generation
The period from 1940 to 1956 is roughly considered as the First Generation
of Computer.
The first generation computers were developed by using vacuum tube or
thermionic valve machine.
The input of this system was based on punched cards and paper tape;
however, the output was displayed on printouts.
The first generation computers worked on binary-coded concept (i.e.,
language of 0-1).
Examples:ENIAC, EDVAC, etc.

ENIAC

SecondGeneration
Theperiodfrom1956to1963isroughlyconsideredastheperiodofSecond
GenerationofComputers.
Thesecondgenerationcomputersweredevelopedbyusingtransistor
technology.
Incomparisontothefirstgeneration,thesizeofsecondgenerationwas
smaller.
Incomparisontocomputersofthefirstgeneration,thecomputingtimetaken
bythecomputersofthesecondgenerationwaslesser.
Examples:IBM1401,IBM7090and7094,UNIVAC1107,PDP-1.

Fourth generation Computer

FifthGeneration
Theperiod2010totilldateandbeyond,roughlyconsideredastheperiodof
fifthgenerationofcomputers.
Bythetime,thecomputergenerationwasbeingcategorizedonthebasisof
hardwareonly,butthefifthgenerationtechnologyalsoincludedsoftware.
Thecomputersofthefifthgenerationhadhighcapabilityandlargememory
capacity.
Workingwithcomputersofthisgenerationwasfastandmultipletaskscould
beperformedsimultaneously.
Someofthepopularadvancedtechnologiesofthefifthgenerationinclude
Artificialintelligence,Quantumcomputation,Nanotechnology,Parallel
processing,etc.

4-Bit Microprocessors
8-Bit Microprocessors
16-Bit Microprocessors
32-Bit Microprocessors
64-Bit Microprocessors
History of Microprocessor

Introductıon
It had number ofemployees around 110,800 (2020) 77.87 billion U.S. dollars revenue

Intel 4004
Introduced in 1971.
It is the first microprocessor by Intel.
It is a 4-bit µP.
Its clock speed was 740KHz.
It had 2,300 transistors.
It could execute around 60,000 instructions per
second.

Introduced in 1976.
It is 8-bit µP.
It’s clock speed is 3 MHz.
Its data bus is 8-bit and address bus is 16-bit.
It had 6,500 transistors.
Could execute 7,69,230 instructions per second.
It could access 64 KB of memory.(2^16)
It had 246 instructions.
Over 100 million copies were sold.
Intel 8085

Intel 8086

Intel 80286

Intel 80386

MMXis a single instruction, multiple data (SIMD)

(Cores 4)
(For gaming and HD multimedia)

Intel Core i7

Computer system
A computer has the
following main units:
Input Unit
Output Unit
Memory Unit
Central Processing Unit

https://www.youtube.com/watch?v=FRCXF1Sak7s

Understanding C program Compilation Process

Architecture of 80386 Processor
Salient Features of 80386
First 32-bit microprocessor in the x86 family
80286 architecture expanded for 32 bit operation
32-bit Processor
32-bit ALU, 32-bit Registers, 32-bit Data Bus, 32-bit Address Bus
Uses 32-bit address for memory and 16-bit address for I/O ports
Maximum physical memory 4 Gb.
Maximum number of I/O ports 64 K.
Built-in Memory Management Unit to support Segmentation, Paging and
Virtual Memory.(e.g. Working of post office)

It supports 8/16/32 bit data operands (downwards compatibility)
It has 32-bit internal registers
It supports 32-bit data bus and 32-bit non-multiplexed address bus
It supports
Physical Address of 4GB
Virtual Address of 64TB (16384*4 GB)
Maximum Segment size of 4GB

It operates in 3 different modes
Real
Protected
Virtual 8086
MMU provides virtual memory, paging and 4 levels of
protection
Clock Frequency : 16 MHz,20MHz,25 MHz and 33MHz
It has 132/100 pin package
Pipelined architecture (Car assembly).
It can operate on 17 different data types (rich).
It support numeric 80387co-processor.

Two versions of 80386 are which are commonly available are:
1) 80386DX 2)80386SX
80386DX 80386SX
1)32 bit address bus 1) 24 bit address bus 16
data bus 32 bit bitdata bus
2)Packaged in 132 pin ceramic 2) 100 pin flat
3) Address 4GB of memory 3) 16 MB of Memory
4) Fetch 4 bytes at a time 4) Fetch 2 bytes at a
time

Development of microprocessor
Decode
Unit
Bus interface unit
Address unit
Inst. Unit
Exec. Unit
Segmentation Unit
Paging Unit
Pre fetch unit

132 Pin diagram of 80386DX
(e.g. 80387)

W/R#:Thewrite/readoutputdistinguishesthewriteandread
cyclesfromoneanother.
•D/C#:Thisdata/controloutputpindistinguishesbetweena
datatransfercyclefromamachinecontrolcycle.
•M/IO#:Thisoutputpindifferentiatesbetweenthememory
andI/Ocycles.
•LOCK#:TheLOCK#outputpinenablestheCPUtoprevent
theotherbusmastersfromgainingthecontrolofthesystem
bus.
•NA#:Thenextaddressinputpin,ifactivated,allowsaddress
pipelining,during80386buscycles

ADS#:Theaddressstatusoutputpinindicatesthattheaddressbus
andbuscycledefinitionpins(W/R#,D/C#,M/IO#,BE0#toBE3#)
arecarryingtherespectivevalidsignals.
•READY#:ThereadysignalsindicatestotheCPUthattheprevious
buscyclehasbeenterminatedandthebusisreadyforthenext
cycle.ThesignalisusedtoinsertWAITstatesinabuscycleandis
usefulforinterfacingofslowdeviceswithCPU.
•VCC:Thesearesystempowersupplylines.
•VSS:Thesereturnlinesforthepowersupply.

BS16#:Thebussize–16inputpinallowstheinterfacingof16bit
deviceswiththe32bitwide80386databus.Successive16bitbus
cyclesmaybeexecutedtoreada32bitdatafromaperipheral.
•HOLD:Thebusholdinputpinenablestheotherbusmastersto
gaincontrolofthesystembusifitisasserted.
•HLDA:Thebusholdacknowledgeoutputindicatesthatavalid
busholdrequesthasbeenreceived.
•BUSY#:ThebusyinputsignalindicatestotheCPUthatthe
coprocessor(80387)isbusywiththeallocatedtask.

ERROR#:TheerrorinputpinindicatestotheCPUthatthe
coprocessorhasencounteredanerrorwhileexecutingits
instruction.
•PEREQ:Theprocessorextensionrequestoutputsignalindicates
totheCPUtofetchadatawordforthecoprocessor.
•INTR:Thisinterruptpinisamaskableinterrupt,thatcanbe
maskedusingtheIFoftheflagregister.
•NMI:Avalidrequestsignalatthenon-maskableinterruptrequest
inputpininternallygeneratesanon-maskableinterruptoftype2.
Signal.

RESET: A high at this input pin suspends the current operation and
restart the execution from the starting location.
• N/C : No connection pins are expected to be left open while
connecting the 80386 in the circuit.

Quiz Time
1) 80386 Can access -------------memory banks
a)2
b)3
c)4
d)1

1) 80386 Can access -------------memory banks
a)2
b)3
c)4
d)1

2) 80386DX has --------bit data bus and --------bit address bus.
a)32 & 30
b)32 & 16
c)16 & 32
d)32 & 32

2) 80386 has --------bit data bus and --------bit address bus.
a)32 & 30
b)32 & 16
c)16 & 32
d)32 & 32

Architecture of 80386
Central processing unit
Memory management unit
Bus interface unit

The Internal Architecture of 80386 is divided into 3 main sections.
1. Central processing unit(CPU)
a. Execution Unit
b. Instruction Unit
2. Memory management unit(MMU)
a. Segmentation Unit
b. Paging Unit
3. Bus interface unit(BIU)

1. Central processing unit(CPU)
Execution Unit:
–Ithas8generalpurposeand8specialpurposeregisterswhich
eitherhandlesdataoraddresses.
–Ithas64-bitbarrelshifter(Abarrelshifterisadigitalcircuitthat
canshiftadatawordbyaspecifiednumberofbitswithouttheuseofany
sequentiallogic)whichincreasesthespeedofallshift,rotate,multiply
anddivideoperations.
–Themultiply/dividelogicimplementsthebit-shift-rotate
algorithmstocompletetheoperationsinminimumtime(for
example32bitmultiplicationisdonein1µs)

•Executionreadsthedecodedinstructionfromtheinstructionqueueand
performstheoperationsthatarespecified.
•Duringtheexecutionofaninstruction,itrequeststhesegmentandpage
unitstogenerateoperandaddressesandthebusinterfaceunitto
performreadorwritebuscyclestoaccessdatainmemoryorI/Odevices.
•Instruction Unit:
–It decodes the opcode bytes received from the 16-byte instruction
queue and arranges them into a 3-decoded instruction queue.
–After decoding it is passed to control section for deriving necessary
control signals.

Central Processing Unit

Memory Management Unit
•MMU consists of a segmentation unit and paging unit.
•Segmentation Unit:
–Itallowstheuseoftwoaddresscomponents-segmentandoffset–
forrelocabilityandsharingofcodeanddata.
–Itallowsamaximumsegmentsizeof4GB.
–Itprovidesa4-levelprotectionmechanismforprotectingand
isolatingsystem’scodeanddatafromthoseofapplicationprogram.

–ThelimitandattributePLA(ProgrammableLogicalArray)checks
segmentlimitsandattributesatsegmentleveltoavoidinvalidaccesses
tocodeanddatainmemorysegment.
•PagingUnit
–Itorganizesphysicalmemoryintermsofpagesof4KBsize.
–Itworksunderthecontrolofsegmentationunit.
–Itconvertslinearaddressesintophysicaladdresses.
–ThecontrolandattributePLAchecksprivilegesatpagelevel.

Checks the privileges
at the page level

Bus Interface Unit
•Ithasaprioritizertoresolvethe
priorityofvariousbusrequests.
Thiscontrolstheaccessofthebus.
•Theaddressdriverdrivesthebus
enableandaddresssignalsA
2–A
31.
•Thepipeline/bussizeunithandles
thecontrolsignalsforpipeliningand
dynamicbussizingunits.
•Thedatabuffersinterfacethe
internaldatabuswithsystembus.
https://www.youtube.com/watch?v=Hn06bfyLO -c
https://www.youtube.com/watch?v=BNVwF3w7M5E
https://www.youtube.com/watch?v=tSw6NLBKRZY

Quiz Time
1) 80386 Architecture is divided in ---------main sections
A) 4
B) 3
C) 2
D) 5

1) 80386 Architecture is divided in ---------main sections
A) 4
B) 3
C) 2
D) 5

2) 80386 organizes physical memory in terms of pages of -----------------size.
a) 4 GB
b) 32 KB
c) 4 KB
d) 4 Byte

2) 80386 organizes physical memory in terms of pages of -----------------size.
a) 4 GB
2) 32 KB
c) 4 KB
d) 4 Byte

•The Intel 386 DX has 32 register resources in the following categories:
–General Purpose Registers
–Segment Registers
–Instruction Pointer and Flags
–Control Registers
–System Address Registers
–Debug Registers
–Test Registers

General Purpose Registers
•Holddataoraddressvalues.
•Itsupportsdataof1,8,16,32and64bits.
•32-bitregisters(8):EAX,EBX,ECX,EDX,ESI,EDI,EBP,andESP.
•Theleastsignificant16bitsoftheregisterscanbeaccessedasin
8086withnamesoftheregistersAX,BX,CX,DX,SI,DI,BP,andSP.

•When accessed as a 16-bit operand, the upper 16 bits of the register
are neither used nor changed.
•8-bit operations can be performed with AL, BL, CL and DL registers.
•The higher bytes are AH, BH, CH and DH.
•The individual byte accessibility offers flexibility for data operations.

Segment Registers
•Segment register(6) − 16 bitsCS, DS, SS , ES , FS & GS etc.
•It holds the addresses of instructions and data in memory,
which are used by the processor to access memory locations.
•The segment registers are
–CS indicates the current code segment
–SS indicates the current stack segment
–DS, ES, FS and GS indicate four current data segments.

•Itisa32-bitregisternamedEIP.
•EIPholdstheoffset/addressofthenextinstructiontobeexecuted.
•Theoffsetisalwaysrelativetothebaseofthecodesegment(CS).
•Thelower16bitsofEIPcontainthe16-bitinstructionpointernamedIP,
whichisusedby16-bitaddressing.

Quiz Time
1)General Purpose Registers supports -----------bit/bits data size
a)1
b)8
c)64
d)All the above

1)General Purpose Registers supports -----------bit/bits data size
a)1
b)8
c)64
d)All the above

2) In 80386, segment registers are ---------of ----------bit size each.
a)6 & 8
b)6 & 16
c)8 & 8
d)8 & 16

2) In 80386, segment registers are ---------of ----------bit size each.
a)6 & 8
b)6 & 16
c)8 & 8
d)8 & 16

32 bit Flag Register
•Bit 17 (VM Bit, Virtual Mode):
–VM bit is set to work in Virtual 8086 mode
When VM flag is set, 80386 switches from protected mode to virtual 8086 mode.
•Bit 16 (RF Bit, Resume Flag):
–RF flag is used with debug register.
–When RF is set, debug fault need to be ignored on the next instruction.
–RF is then automatically reset after every instruction
•Bit 15 : Reserved

•Bit 14 (NT Bit, Nested Task):
–This flag applies to Protected Mode.
–NT is set to indicate that the execution of this task is nested within
another task.
–If set, it indicates that the current nested task's Task State Segment (TSS)
has a valid back link to the previous task's TSS.
•Bit 13,12 (IOPL Bit, Input/output Privilege):
–MaximumCPL(currentprivilegelevel)valuepermittedtoexecuteI/O
instructionswithoutgeneratinganexception13faultorconsultingtheI/O
PermissionBitmap.

•Bit 11 (OF Bit, Overflow Flag):
–OF is set if the operation resulted in a signed overflow.
•Bit 10 (DF Bit, Direction Flag):
–DF defines whether ESI/EDI registersdecrement or increment during the
string instructions.
–increment occurs ifDF is reset.
–decrement occurs if DF isset.

•Bit 9 (IF Bit, Interrupt Enable Flag):
–When IF =1 the processor allows recognition of external interrupts on
INTR pin.
•Bit 8 (TF Bit, Trap Enable Flag):
–When TF =1 the processor enables the single step mode for debugging.
•Bit 7 (SF Bit, Sign Flag):
–SF is set if the high-order bit of the result isset, it is reset otherwise.

•Bit 6 (ZF bit, Zero Flag):
–ZF is set if all bits of the result are 0.
•Bit 4 (AF Bit, Auxiliary Carry Flag):
–The Auxiliary Flag is used to simplify the additionand subtraction of packed
BCD numbers.
–AF is set if the operation resulted in acarry out of bit 3 (addition) or a
borrow into bit3 (subtraction). Otherwise AF is reset.
–AF is only for bit 3.

•Bit 2 (PF Bit, Parity Flag):
–PF is set for even parity ( i.e. 00111001 even parity).
•Bit 0 (CF Bit, Carry Flag):
–CF is set for 8, 16 or 32-bit operations if it results in a carry out of
(addition), or a borrow into (subtraction) the high-order bit.

Six Conditional Flags
◦Carry Flag (CF)
◦Parity Flag (PF)
◦Auxiliary Flag( AF)
◦Zero Flag (ZF)
◦Sign Flag (SF)
◦Overflow Flag (OF)
Three Control Flags
◦Interrupt Flag (IF)
◦Trap Flag (TF)
◦Direction Flag (DF)
Four System Flags
◦Input/output privilege level (IOPL)
◦Nested Task (NT)
◦Resume Flag (RF)
◦Virtual Mode Flag (VM)

Quiz Time
1) In 80386, 32 bit Flag Register _________ bits are reserved for Intel.
a)15
b)14
c)16
d)17

1) In 80386, 32 bit Flag Register _________ bits are reserved for Intel.
a)15
b)14
c)16
d)17

2 ) In 80386 , _________ bit is used for virtual mode.
a)15
b)14
c)16
d)17

2 )In 80386 , _________ bit is used for virtual mode.
a)15
b)14
c)16
d)17

3 ) In 80386 , there are _________ system flags.
a)5
b)4
c)6
d)3

3 )In 80386 , there are _________ system flags.
a)5
b)4
c)6
d)3

Control Registers
•Intel 386 DX has 4 control registers (CR0, CR1 ,CR2 & CR3) of 32 bits to hold
machine state of a global nature.
•These registers along with System Address Registers hold machine state that
affects all tasks in the system.
•To access Control Registers, load and storeinstructions are defined.
•CR0 contains 6 defined bits for control and status purposes.

•The low-order 16 bits of CR0 is defined as Machine Status Word.
•To operate only on the low-order 16-bits of CR0, LMSW and SMSW
instructions are usedfor load and store respectively.
•For 32-bit operations the system should use MOV CR0, Reginstruction.

•Bit 31 (PG Bit, Paging Enable) : The PG bit is set to enable the on-chip paging
unit.
•Bit 4 (Reserved) : This bit is reserved by Intel.
•Bit 3 (TS Bit, Task Switched) : TS is automatically set whenever a task switch
operation is performed.
•Bit 2 (EM Bit, Emulate Coprocessor) :The EM bit indicates whether
coprocessor functions are to be emulated.
•Bit 1 (MP Bit, Monitor Coprocessor) :The EM and MP flags of CR0 control
how the processor reacts to coprocessor instructions.
•TheMOVinstruction can be executed only at privilege level zero (OS
level).

•Bit 0 (PE Bit, Protection Enable) :
–PE =1, enable the Protected Mode.
–If PE =0, processor operates in Real Mode.
Trap-and-emulate isa technique used by the virtual machine to emulate privileged
instructions and registers.
TheEMandMPflagsofCR0controlhowtheprocessorreactsto
coprocessorinstructions.TheEMbitindicateswhether
coprocessorfunctionsaretobeemulated.
TheMP(monitorcoprocessor)bitindicateswhethera
coprocessorisactuallyattachedORNOT.
TheEMandMPflagscanbechangedwiththeaidof
aMOVinstruction

•CR1 is reserved for use in future Intel processors
CR2
•CR2 holds the 32-bit linear address that caused the last page fault detected.
i.e. the processor stores in CR2 the linear address that triggers the fault

CR3 : Page Directory Base Address
•CR3 contains the physical base address of the page directory table.
•The Intel 386 DX page directory table is always page-aligned (4 Kbyte-aligned).
•Thus the lowest twelve bits of CR3 are ignored (12 bits).
11

1)In 80386, ------control register is used for page fault linear
address.
a) CR0
b) CR1
c) CR2
d) CR3
Quiz Time

1)In 80386, ------control register is used for page fault linear
address.
a) CR0
b) CR1
c) CR2
d) CR3

2) In 80386, ------bits of CR0 register are used while other bits are
reserved.
a) 5
b) 4
c) 6
d) 3

2) In 80386, ------bits of CR0 register are used while other bits are
reserved.
a)5
b) 4
c) 6
d) 3

3) --------bits is the size of Page Directory Base Register in CR3.
a)18
b) 20
c) 22
d) 24

3) --------bits is the size of Page Directory Base Register in CR3.
a)18
b) 20
c) 22
d) 24

4)In 80386, ----------is the size of Machine Status Word (MSW)
a)8
b)16
c)18
d)17

4)In 80386, ----------is the size of Machine Status Word
a)8
b)16
c)18
d)17

System Address Registers
•Four special registers are defined to reference the tables.
•These tables or segments are:
–GDT (Global Descriptor Table)
–IDT (Interrupt Descriptor Table)
–LDT (Local Descriptor Table)
–TSS (Task State Segment)
•The addresses of these tables and segments are stored in special registers, the
System Address and System Segment Registers respectively.
•These registers are named GDTR, IDTR, LDTR and TR.

The Global Descriptor Table
GDTisadatastructureusedbyIntelx86-familyprocessors
startingwiththe80286inordertodefinethecharacteristicsof
thevariousmemoryareasusedduringprogramexecution,
includingthebaseaddress,thesize,andaccessprivilegeslike
executabilityandwritability.
GDTcontainsdescriptorsofallthetasksinasystem.
GDTcontainanytypeofsegmentdescriptorexceptinterrupt
andtrapdescriptor.

What is an LDT?
TheLocalDescriptorTableisalistofdescriptorsforthecurrent
program.
ItisdistinctfromtheGDTinanumberofrespectsi.e.oneand
manyrespectively.
LDTcannotholdmanytypesofdescriptors;
ItisonlyaccessiblebyTasks/threadswiththesameLocal
DescriptorTableRegister(LDTR)value.

GDTR and IDTR
•These registers hold:
–16-bit limit
–32-bit linear base address and

LDTR and TR
•These registers hold 16-bit selector for
–LDT (Local Descriptor Table )descriptor and
–TSS ( Task State Segment )descriptor
•Since they are task specific, they are defined by selector values stored in
system segment registers.

System Segment Registers

How Segment Descriptor is accessed?
Requested Privilege Level (RPL)
(Bits 0and 1) —Specifiestheprivilegelevel of
theselector.

RealMode ProtectedMode
-Doesnotsupportvirtual
addressspace
-Givesvirtualandphysical
addressspace
-DoesnotsupportLDTandGDT
-Dosenotsupportprotection
mechanism and multi
programmingenvironment
-It supports protection
mechanism and multi
programmingenvironment
Difference between real mode and protected mode of 80386?
Real mode hassame base architectureas that of 8086, but allows
access to the 32-bit register set of 80386.
...
-Supports LDT and GDT
https://www.youtube.com/watch?v=eDrp2n2JDr8

Quiz Time
1)GDT contains descriptors of ---------tasks in a system.
A)2
B)8
C)16
D)All

1)GDT contains descriptors of ---------tasks in a system.
A)2
B)8
C)16
D)All

2) -------bits is the size of GDTR/IDTR
A)32
B)24
C)8
D)48

2) -------bits is the size of GDTR/IDTR
A)32
B)24
C)8
D)48

3) To select LDT/GDT --------bit is used in segment register
a)1
b)2
c)3
d)4

3) To select LDT/GDT --------bit is used in segment register
a)1
b)2
c)3
d)4

4)In 80386, ----------is the size of descriptor register
a)4 byte
b)2 byte
c)8 byte
d)1 byte

In 803686, ----------is the size of descriptor register in 803686
a)4 byte
b)2 byte
c)8 byte
d)1 byte

Segment selector
InRealmode16bitsegmentregistersholdthestartingaddressof
thesegment.
InProtectedmodethesesegmentregistersareusedassegment
selectorbecauseitselectsasegmentdescriptor.
Segmentdescriptorisastructureof8bytes(64bits)thatisusedto
describeandlocatesegmentpresentinmemoryfromdescriptor
table.
Selectorisusedtoindex(point)adescriptorfromthetableof
descriptors.

Hence
Everymemoryaccesswhichaprogramcanperformalways
goesthroughasegmentselector.
Inordertoreferenceasegment,aprogrammustuseitsindex
insidetheGDTortheLDT.
Suchanindexiscalledasegmentselector(orselector).
Theselectormustgenerallybeloadedintoasegmentregisterto
beused.

Interrupt Descriptor Table & IDTR
IDTcontainsgroupofdescriptorsthatdefinetheinterruptsor
exceptionhandlingroutines.
For80386toworkinprotectedmodeatleastoneIDTneedstobe
defined.
TheIDTcontainsthedescriptorswhichpointtothelocationofup
to256interruptserviceroutine(ISR).
EveryinterruptusedbythesystemmusthaveanentryintheIDT.

16

However,80386supports3operatingmodes:real,protectedand
virtualrealmode.
Initiallythe80386wasbootedinrealmode.
Protectedmodeonthe386offerstheprogrammerbetter
protectionandmorememorythanonthe286.
386alsosupportsathirdmode,Virtual8086(V86)mode.
InV86mode,the386operatesinprotectedmodebutallowsto
useasimulatedreal-modeenvironment.

Quiz Time
1)Segment descriptor is a structure of ------------------bytes
A)4
B)2
C)8
D)16

1)Segment descriptor is a structure of ------------------bytes
A)4
B)2
C)8
D)16

2) IDT contains the descriptors which point to the location of
up to -----------interrupt service routine.
a)64
b)128
c)256
d)32

2) IDT contains the descriptors which point to the location of up
to -----------interrupt service routine.
a)64
b)128
c)256
d)32

Data Types
The Intel 386 DX supports all of the data types commonly
used in high level languages:
Bit: A single bit quantity.
Bit Field: A group of up to 32 contiguous bits,
which spans a maximum of four bytes.

Bit String: A set of contiguous bits, on the Intel386 DX bit strings can
be up to 4 gigabits long.
Byte: A signed
8-bit quantity
(range -128 to+127)

•Unsigned Byte: An unsigned 8-
bit quantity.
(range 0 to 255)
•Integer (Word): A signed 16-bit
quantity.
(-32768 to 32767)
•Long Integer (Double Word):
–A signed 32-bit quantity.
(-2.147*10
9
to + 2.147*10
9 )

•Unsigned Integer (Word): An
unsigned 16-bit quantity.
(0 to 65535)
•Unsigned Long Integer (Double
Word): An unsigned 32-bit
quantity.(0 to 4294967295)

•Signed Quad Word: A signed 64-bit quantity.
•Unsigned Quad Word: An unsigned 64-bit quantity.

Offset:A16-or32-bitoffsetonlyquantitywhichindirectly
referencesanothermemorylocation.

•Pointer:Afullpointerwhichconsistsofa16-bit
segmentselectorandeithera16-or32-bitoffset.
16 bits 32 bits

Char:A byte representation of an ASCII Alphanumeric or control
character.

Quiz Time
1)Signed quad word data type is having --------bit size.
a)32
b)128
c)24
d)64

Signed quad word data type is having --------bit size.
a)32
b)128
c)24
d)64

Data Addressing Modes
The 80386 memoryaddressing modesprovide flexible access to
memory, allowing you to easily access variables, arrays, records,
pointers, and other complex data types.
Following figure illustrates the MOV instruction and defines the direction
of data flow

Immediate Addressing
•Term immediateimplies that data immediately follow the hexadecimal
opcode in the memory.
–immediate data are constant data
•Immediate addressing operates upon a byte or word of data.
•Figure shows the operation of a MOV EAX,13456H instruction.
opcode Operand
(Opcodeis a part of the instruction that tells the processor what should be done.Operandis a part of the
instruction that contains the data to be acted on, or the memory location of the data in a register)
Instruction

Figure The operation of the MOV EAX,3456H instruction.
This instruction copies the immediate data 13456H into EAX.
The source data overwrites the destination data.

Register Addressing Mode
•Themostcommonformofdataaddressing.
•Themicroprocessorcontainsthese8-bitregisternamesusedwith
registeraddressing:AH,AL,BH,BL,CH,CL,DH,andDL.
•16-bitregisternames:AX,BX,CX,DX,SP,BP,SI,andDI.

•In 80386 & above, extended 32-bit register names are: EAX,
EBX, ECX, EDX, ESP, EBP, EDI, and ESI.
•It is important for instructions, to use registers which are the
same size.
–nevermix an 8-bit \with a 16-bit register, an 8-or a 16-bit
register with a 32-bit register
–this is not allowed by the microprocessor and results in an
error when assembled
for example MovEAX, DX

FigureTheeffectofexecutingtheMOVBX,CXinstruction
atthepointjustbeforetheBXregisterchanges.
Notethatonlytherightmost16bitsofregisterEBXchange.
15
31

•FigureshowstheoperationoftheMOVBX,CXinstruction.
•Thesourceregister’scontentsdonotchange.
thedestinationregister’scontentsdochange
•Thecontentsofthedestinationregisterordestinationmemory
locationchangeforallinstructionsexcepttheCMPandTEST
instructions.
•TheMOVBX,CXinstructiondoesnotaffecttheleftmost16bitsof
registerEBX.

The remaining modes provide a mechanism for specifying the
effective address (EA)of an operand.
The linear address consists of two components:
The segment base address and
An effective address.

The effective address is calculated by using four address elements:
DISPLACEMENT: An 8 bit or 32-bit immediate value
BASE: The contents of any general purpose register. It point to
the start of the local variable area.
INDEX: The index registers are used to access the elements of an
array, or a string of characters.
SCALE: The index register's value can be multiplied by a scale
factor, either 1, 2, 4 or 8.
Scaled index mode is especially useful for accessing arrays or
structures.

Combinationsofthese4components makeupthe
additionaladdressingmodes.
Theeffectiveaddress(EA)ofanoperandiscalculated
accordingtothefollowingformula:
EA=BaseRegister+(IndexRegister*Scaling)+
Displacement.

Effective address (EA) calculation can be shown as follows:

Direct Addressing Modes
•Appliedtomanyinstructionsinatypicalprogram.
•Twobasicformsofdirectdataaddressing:
–directaddressing,whichappliestoaMOVbetweena
memorylocationandAL,AX,orEAXregisters.
–displacementaddressing,whichappliestoalmostany
instructionintheinstructionset.
•Addressisformedbyaddingthedisplacementtothedefault
datasegmentaddressoranalternatesegmentaddress.

Figure The operation of the MOV AL,[1234H] instruction
when DS=10000H .
•This instruction transfers a copy contents of memory location 11234H
into AL.
–the effective address is formed by adding
1234H (the offset address) and 10000H

Register Indirect Addressing Mode:
•Allows data to be addressed at any memory location through
an offset address held in any of the following registers: BP, BX, DI,
and SI.
•In addition, 80386 and above processors allow register indirect
addressing with any extended register except ESP.

Indirect addressing often allows a program to refer to tabular
data located in memory.
Figure5showsthetableandtheBXregisterusedto
sequentiallyaddresseachlocationinthetable.
To accomplish this task, load the starting location of the table
into the BX register with a MOV immediate instruction.
After initializing the starting address of the table, use register
indirect addressing to store the 50 samples sequentially.

Figure 4The operation of the MOV AX,[BX] instruction when BX =
1000H and DS = 0100H. Note that this instruction is shown after the
contents of memory are transferred to AX.
(100*10)

Base-Plus-Index Addressing
•Similartoindirectaddressingbecauseitindirectlyaddresses
memorydata.
•Thebaseregisteroftenholdsthebeginninglocationofamemory
array.
–the index registerholdsthe relativeposition
ofanelementinthearray.
–wheneverBPaddressesmemorydata,boththestacksegment
registerandBPgeneratetheeffectiveaddress

•Figure 6 shows how data are addressed by the
MOV DX,[BX + DI] instruction when the microprocessor operates
in the real mode.
•The Intel assembler requires this addressing mode appear as
[BX][DI] instead of [BX + DI].
•The MOV DX,[BX + DI] instruction is MOV DX,[BX][DI] for a
program written for the Intel ASM assembler.

Figure An example showing how the base-plus-index addressing
mode functions for the MOV DX,[BX + DI] instruction.
Notice that memory address 02010H is accessed because DS=0100H,
BX=1000H and DI=0010H.

scale

(Accumulator)

Memory Based Addressing Modes Register Based Addressing Modes
The operand is present in memory and its address is given in
the instruction itself. This addressing mode is taking proper
advantage of memory address, e.g., Direct addressing mode
An operand will be given in one of the register and register number will
be provided in the instruction . With the register number present in
instruction, operand is fetched, e.g., Register mode
The memory address specified in instruction may give the
address where the effective address is stored in the memory.
In this case effective memory address is present in the
memory address which is specified in the instruction, e.g.,
Indirect Addressing Mode
The register contains the address of the operand. The effective address
can be derived from the content of the register specified in the
instruction. The content of the register might not be the effective
address. This mode takes full advantage of registers, e.g., Register
indirect mode
The content of base register is added to the address part of
the instruction to obtain the effective address. A base register
is assumed to hold a base address and the address field of
the instruction gives displacement relative to the base
address, e.g., Base Register Addressing Mode
If we are having a table of data and our program needs to access all
the values one by one we need something which decrements the
program counter/or any register which has base address. Though in this
case register is basically decreased, it is register based addressing
mode, e.g., In Auto decrements mode
The content of the index register is added to the address part
that is given in the instruction to obtain the effective address.
Index Mode is used to access an array whose elements are in
successive memory locations, e.g., Indexed Addressing Mode
If we are having a table of data and our program needs to access all
the values one by one we need something which increment the
program counter/or any register which has base address, e.g., Auto
increment mode
The content of program counter is added to the address part
of the instruction in order to obtain the effective address. The
address part of the instruction in this case is usually a signed
number which can be either positive or negative, e.g.,
Relative addressing mode
Instructions generally used for initializing registers to a constant value is
register based addressing mode, and this technique is very useful
approach, e.g., Immediate mode.

CISC&RISC(ComplexInstructionSetComputer&ReducedInstruction
SetComputer)
CISC
Intheearlydaysofcomputerhistory,mostcomputerfamiliesstartedwithan
instructionsetwhichwassimple.
Themainreasonforbeingsimplethenwasthehighcostofhardware/technology
anduse.
Thehardwarecosthasdroppedandthesoftwarecosthasgoneupsteadilyinthe
pastdecades.
Furthermore,thesemanticgapbetweenHLLfeaturesandcomputerarchitecture
haswidened.
Nowadaysmoreandmorefunctionswerebuiltintothehardware,makingthe
instructionsetlargeandcomplex.

Thegrowthofinstructionsetswasalsoincreasedbecauseofthepopularityof
usingmicrocodesinsomeprocessorsforspecial-purposeapplications.
AtypicalCISCinstructionsetcontainsapproximately120to350instructions
usingvariableinstruction/dataformats,usesasmallsetof8to24general-
purposeregisters(GPRs).
ManyHLLstatementsaredirectlyimplementedinhardware/firmwareina
CISCarchitecture.
Thismaysimplifythecompilerdevelopment,improveexecutionefficiency,
andallowanextensionfromscalarinstructionstovectorinstructions.

RISC
WestartedwithRISCinstructionsetsandgraduallymovedtoCISCinstructionsets
duringthe1980s.
AftertwodecadesofusingCISCprocessors,computerusersbegantoreevaluate
theperformancerelationshipbetweeninstruction-setarchitectureandavailable
hardware/softwaretechnology.
Frommanyyearscomputerscientistsrealizedthatonly25%oftheinstructionsofa
complexinstructionsetarefrequentlyusedabout95%ofthetime.
Itmeansabout75%ofhardware-supportedinstructionsoftenarenotusedatall.
Thenwhyshouldwewastevaluablechipareaforrarelyusedinstructions?

Itmaybemoreadvantageoustoremovethemcompletelyfromthehardware
andrelyonsoftwaretoimplementthem.
Evenifthesoftwareimplementationisslow,thenetresultwillbestillaplus
duetotheirlowfrequencyofuse.
Pushingrarelyusedinstructionsintosoftwarewillvacatechipareasfor
buildingmorepowerfulRISCorsuperscalarprocessors,evenwithon-chip
cachesorfloating-pointunits.
ARISCinstructionsettypicallycontainslessthan100instructionswithafixed
instructionformat(32bits).
WhereasCISCprocessoruses120to350instructions

Onlythreetofivesimpleaddressingmodesareused.
Mostinstructionsareregister-based.
Memoryaccessisdonebyload/storeinstructionsonly.
Alargeregisterfileisusedtoimprovefastcontextswitchingamongmultiple
programs,andmostinstructionsexecuteinonecyclewithhardwiredcontrol.
Becauseofthereductionininstruction-setcomplexity(numberofinstructions),
theentireprocessorisimplementableonasingleVLSIchip.

TheresultingbenefitsincludeahigherclockrateandalowerCPI(Cyclesper
instruction),whichleadtohigherMIPSratingsasreportedoncommercially
availableRISC/superscalarprocessors.

Cycles per instruction

Intel core i9 processor
Technical Specifications of Intel core i9
Performance
Intel® Thermal Velocity Boost Frequency
5.20 GHz
# of Cores
10
# of Threads
20 (EachCPU corecan have twothreads)
Processor Base Frequency
3.60 GHz
Max Turbo Frequency
5.20 GHz
(Thermal Velocity Boost allows these CPUs to hit even higher boost speeds than its
typical all-core turbo boost.)

Cache
20 MB
Bus Speed
8 GT/s (gigatansfer/second)
Memory Specifications
Max Memory Size (dependent on memory type)
128 GB
Memory Types
DDR4-2933 (double data rate fourth generation)
Max # of Memory Channels
2
Max Memory Bandwidth
45.8 GB/s
(The number ofthreadsdepends on the number ofcoresin yourCPU. EachCPU
corecan have twothreads. So a processor with twocoreswill have fourthreads.
Threads are virtual codes which divides the physical core of CPU into virtual
multiple cores)

List of Intel Core i9 processors Land grid array(LGA) for interface
(Thermal
Power) power
consumption
Tags