This document discusses the organization of registers and stacks in a CPU. It describes how a CPU contains a register set that is used to store intermediate values and pointers to improve efficiency over memory access. A general register organization is shown using multiplexers and decoders to select registers for arithmetic operations. The document also introduces the concept of a stack, which uses a last-in, first-out data structure and stack pointer register to efficiently insert and delete items for functions.
FellowBuddy.com is an innovative platform that brings students together to share notes, exam papers, study guides, project reports and presentation for upcoming exams.
We connect Students who have an understanding of course material with Students who need help.
Benefits:-
# Students can catch up on notes they missed because of an absence.
# Underachievers can find peer developed notes that break down lecture and study material in a way that they can understand
# Students can earn better grades, save time and study effectively
Our Vision & Mission – Simplifying Students Life
Our Belief – “The great breakthrough in your life comes when you realize it, that you can learn anything you need to learn; to accomplish any goal that you have set for yourself. This means there are no limits on what you can be, have or do.”
Like Us - https://www.facebook.com/FellowBuddycom
(Ref : Computer System Architecture by Morris Mano 3rd edition) : Microprogrammed Control unit, micro instructions, micro operations, symbolic and binary microprogram.
This slide provide the introduction to the computer , instruction formats and their execution, Common Bus System , Instruction Cycle, Hardwired Control Unit and I/O operation and handling of interrupt
FellowBuddy.com is an innovative platform that brings students together to share notes, exam papers, study guides, project reports and presentation for upcoming exams.
We connect Students who have an understanding of course material with Students who need help.
Benefits:-
# Students can catch up on notes they missed because of an absence.
# Underachievers can find peer developed notes that break down lecture and study material in a way that they can understand
# Students can earn better grades, save time and study effectively
Our Vision & Mission – Simplifying Students Life
Our Belief – “The great breakthrough in your life comes when you realize it, that you can learn anything you need to learn; to accomplish any goal that you have set for yourself. This means there are no limits on what you can be, have or do.”
Like Us - https://www.facebook.com/FellowBuddycom
(Ref : Computer System Architecture by Morris Mano 3rd edition) : Microprogrammed Control unit, micro instructions, micro operations, symbolic and binary microprogram.
This slide provide the introduction to the computer , instruction formats and their execution, Common Bus System , Instruction Cycle, Hardwired Control Unit and I/O operation and handling of interrupt
Computer Architecture – An IntroductionDilum Bandara
Overview on high-level design of internal components of a computer. Cover step-by-step execution of a program through ALU while accessing & updating registers
About Cache Memory
working of cache memory
levels of cache memory
mapping techniques for cache memory
1. direct mapping techniques
2. Fully associative mapping techniques
3. set associative mapping techniques
Cache memroy organization
cache coherency
every thing in detail
The presentation given at MSBTE sponsored content updating program on 'PC Maintenance and Troubleshooting' for Diploma Engineering teachers of Maharashtra. Venue: Government Polytechnic, Nashik Date: 17/01/2011 Session-2: Computer Organization and Architecture.
Topics included:
===============================================
The different types of computers
The basic structure of a computer and its operation
Machine instructions and their execution
Integer, floating-point, and character representations
Addition and subtraction of binary numbers
Basic performance issues in computer systems
A brief history of computer development
What is Instruction format
CPU organisation
Types of instructions
Types of address
Two address instruction
One address instruction
Three address instruction
Stack Organisation
What is a programme
Zero address instruction
Computer Architecture – An IntroductionDilum Bandara
Overview on high-level design of internal components of a computer. Cover step-by-step execution of a program through ALU while accessing & updating registers
About Cache Memory
working of cache memory
levels of cache memory
mapping techniques for cache memory
1. direct mapping techniques
2. Fully associative mapping techniques
3. set associative mapping techniques
Cache memroy organization
cache coherency
every thing in detail
The presentation given at MSBTE sponsored content updating program on 'PC Maintenance and Troubleshooting' for Diploma Engineering teachers of Maharashtra. Venue: Government Polytechnic, Nashik Date: 17/01/2011 Session-2: Computer Organization and Architecture.
Topics included:
===============================================
The different types of computers
The basic structure of a computer and its operation
Machine instructions and their execution
Integer, floating-point, and character representations
Addition and subtraction of binary numbers
Basic performance issues in computer systems
A brief history of computer development
What is Instruction format
CPU organisation
Types of instructions
Types of address
Two address instruction
One address instruction
Three address instruction
Stack Organisation
What is a programme
Zero address instruction
This talk is all about the Berkeley Packet Filters (BPF) and their uses in Linux.
Agenda:
* What is a BPF and why do we need it?
* Writing custom BPFs
* Notes on BPF implementation in the kernel
* Usage examples: SOCKET_FILTER & seccomp
Speaker:
Kfir Gollan, senior embedded software developer, Linux kernel hacker and software team leader.
IJRET : International Journal of Research in Engineering and Technology is an international peer reviewed, online journal published by eSAT Publishing House for the enhancement of research in various disciplines of Engineering and Technology. The aim and scope of the journal is to provide an academic medium and an important reference for the advancement and dissemination of research results that support high-level learning, teaching and research in the fields of Engineering and Technology. We bring together Scientists, Academician, Field Engineers, Scholars and Students of related fields of Engineering and Technology.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Normal Labour/ Stages of Labour/ Mechanism of LabourWasim Ak
Normal labor is also termed spontaneous labor, defined as the natural physiological process through which the fetus, placenta, and membranes are expelled from the uterus through the birth canal at term (37 to 42 weeks
Safalta Digital marketing institute in Noida, provide complete applications that encompass a huge range of virtual advertising and marketing additives, which includes search engine optimization, virtual communication advertising, pay-per-click on marketing, content material advertising, internet analytics, and greater. These university courses are designed for students who possess a comprehensive understanding of virtual marketing strategies and attributes.Safalta Digital Marketing Institute in Noida is a first choice for young individuals or students who are looking to start their careers in the field of digital advertising. The institute gives specialized courses designed and certification.
for beginners, providing thorough training in areas such as SEO, digital communication marketing, and PPC training in Noida. After finishing the program, students receive the certifications recognised by top different universitie, setting a strong foundation for a successful career in digital marketing.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
1.4 modern child centered education - mahatma gandhi-2.pptx
Ch8 (1) morris mano
1. 8-1. Introduction 1 / 22 8-2. General Register Organization 3 / 22
n 8-1 Introduction u Binary selector input : 예제 R1 ← R 2 + R 3
u 3 major parts of CPU : Fig. 8-1 l 1) MUX A selector (SELA) : to place the content of R2 into BUS A
l 1) Register Set l 2) MUX B selector (SELB) : to place the content of R3 into BUS B
l 2) ALU l 3) ALU operation selector (OPR) : to provide the arithmetic addition R2 + R3
l 3) Control l 4) Decoder selector (SELD) : to transfer the content of the output bus into R1
u Design Examples of simple CPU u Control Word
l Hardwired Control : Chap. 5 l 14 bit control word (4 fields) : Fig. 8-2(b)
» SELA (3 bits) : select a source register for the A input of the ALU
l Microprogrammed Control : Chap. 7
» SELB (3 bits) : select a source register for the B input of the ALU Tab. 8-1
u In this chapter : Chap. 8 Computer Architecture as seen by the programmer
» SELD (3 bits) : select a destination register using the 3 X 8 decoder
l Describe the organization and architecture of the CPU with an emphasis on the » OPR (5 bits) : select one of the operations in the ALU Tab. 8-2
user’ view of the computer
s l Encoding of Register Selection Fields : Tab. 8-1
l User who programs the computer in machine/assembly language must be aware » SELA or SELB = 000 (Input) : MUX selects the external input data
of » SELD = 000 (None) : no destination register is selected but the contents of the output
» 1) Instruction Formats bus are available in the external output
Chap. 8 의 주요 내용 Control Word를 Control Memory에
» 2) Addressing Modes l Encoding of ALU Operation (OPR) : Tab. 8-2 저장하여 Microprogrammed
» 3) Register Sets Control 방식으로 제어 가능함
u Examples of Microoperations : Tab. 8-3
l The last section presents the concept of Reduced Instruction Set Computer
l TSFA (Transfer A) : R 7 ← R1, External Output ← R 2, External Output ← External Input
(RISC)
l XOR : R5 ← 0 ( XOR R5 ⊕ R 5)
Computer System Architecture Chap. 8 Central Processing Unit Computer System Architecture Chap. 8 Central Processing Unit
8-2. General Register Organization 2 / 22 8-3. Stack Organization 4 / 22
n 8-2 General Register Organization n 8-3 Stack Organization
External Input
u Register의 필요성 u Stack or LIFO(Last-In, First-Out)
Clock Input
l Memory locations are needed for storing
l A storage device that stores information
pointers, counters, return address, temporary R1
» The item stored last is the first item retrieved = a stack of tray
results, and partial products during multiplication R2
R3
(in the programming examples of Chap. 6) R4
l Stack Pointer (SP)
l Memory access is the most time-consuming
R5 » The register that holds the address for the stack
R6
operation in a computer R7 » SP always points at the top item in the stack
l More convenient and efficient way is to store Load
l Two Operations of a stack : Insertion and Deletion of Items
intermediate values in processor registers (7 lines)
SELA MUX MUX SELB » PUSH : Push-Down = Insertion Address
u Bus organization for 7 CPU registers : Fig. 8-2 » POP : Pop-Up = Deletion 64
l 2 MUX : select one of 7 register or external data
3×8 A bus B bus
decoder l Stack의 종류
input by SELA and SELB » 1) Register Stack (Stack Depth가 제한) FULL EMTY
l BUS A and BUS B : form the inputs to a SELD Arithmetic logic unit n a finite number of memory words or register(stand alone)
OPR (ALU)
common ALU » 2) Memory Stack (Stack Depth가 유동적)
l ALU : OPR determine the arithmetic or logic n a portion of a large memory 4
External Output
microoperation u Register Stack : Fig. 8-3
SP C 3
Output B 2
» The result of the microoperation is available for (a) Block diagram
l PUSH : SP ← SP + 1
A 1
external data output and also goes into the inputs 3 3 3 5 : Increment SP Last Item 0
of all the registers SELA SELB SELD OPR * 초기 상태 M [ SP ] ← DR : Write to the stack
SP = 0,
l 3 X 8 Decoder : select the register (by SELD) (b) Control word
EMTY = 1, If ( SP = 0 ) then ( FULL ← 1) : Check if stack is full
that receives the information from ALU DR
FULL = 0 EMTY ← 0 : Mark not empty
Computer System Architecture Chap. 8 Central Processing Unit Computer System Architecture Chap. 8 Central Processing Unit
2. 8-3. Stack Organization 5 / 22 8-4. Instruction Formats 7 / 22
» The first item is stored at address 1, and the last item is stored at address 0 u 3 types of CPU organizations X = Operand Address
l POP : DR ← M [ SP ] : Read item from the top of stack * Memory Stack
l 1) Single AC Org. : ADD X AC ← AC + M [ X ]
PUSH = Address 감소
SP ← SP − 1 : Decrement Stack Pointer R1 ← R 2 + R 3
* Register Stack l 2) General Register Org. : ADD R1, R2, R3
If ( SP = 0 ) then ( EMTY ← 1) : Check if stack is empty PUSH = Address 증가
l 3) Stack Org. : PUSH X TOS ← M [ X ]
FULL ← 0 : Mark not full Address
Memory unit
u The influence of the number of addresses on computer instruction
u Memory Stack : Fig. 8-4 PC
1000
[예제] X = (A + B)*(C + D)
l PUSH : SP ← SP − 1 Program
(instructions) - 4 arithmetic operations : ADD, SUB, MUL, DIV
M [ SP ] ← DR
* 초기 상태
2000 - 1 transfer operation to and from memory and general register : MOV
SP = 4001 » The first item is stored at address 4000 AR
Data - 2 transfer operation to and from memory and AC register : STORE, LOAD
l POP : DR ← M [ SP ] (operands)
- Operand memory addresses : A, B, C, D
SP ← SP + 1 * Error Condition
3000
PUSH when FULL = 1 - Result memory address : X
Stack
u Stack Limits POP when EMTY = 1
l 1) Three-Address Instruction
l Check for stack overflow(full)/underflow(empty) 3997 ADD R1, A, B R1 ← M [ A] + M [ B ]
SP 3998
» Checked by using two register
3999
ADD R2, C, D R 2 ← M [C ] + M [ D ]
n Upper Limit and Lower Limit Register
4000 MUL X, R1, R2 M [ X ] ← R1 ∗ R 2
» After PUSH Operation 4001
Start Here » Each address fields specify either a processor register or a memory operand
n SP compared with the upper limit register
» After POP Operation » : Short program
» Require too many bit to specify 3 address
y
n SP compared with the lower limit register DR
Computer System Architecture Chap. 8 Central Processing Unit Computer System Architecture Chap. 8 Central Processing Unit
8-4. Instruction Formats 6 / 22 8-4. Instruction Formats 8 / 22
u RPN (Reverse Polish Notation) Stack을 이용한 Arithmetic l 2) Two-Address Instruction
l The common mathematical method of writing arithmetic expressions imposes MOV R1, A R1 ← M [ A ]
difficulties when evaluated by a computer ADD R1, B R1 ← R1 + M [ B ]
l A stack organization is very effective for evaluating arithmetic expressions MOV R2, C R 2 ← M [C ]
l 예제) A * B + C * D → AB * CD * + : Fig. 8-5 ADD R2, D R2 ← R2 + M [D]
» ( 3 * 4 ) + ( 5 * 6 ) → 34 * 56 * + MUL R1, R2 R1 ← R1 ∗ R 2
MOV X, R1 M [ X ] ← R1
» The most common in commercial computers
6
» Each address fields specify either a processor register or a memory operand
4 5 5 30
l 3) One-Address Instruction
3 3 12 12 12 12 42 LOAD A AC ← M [ A]
3 4 * 5 6 * + ADD B AC ← A[C ] + M [ B ]
STORE T M [T ] ← AC
n 8-4 Instruction Formats LOAD C AC ← M [C ]
u Fields in Instruction Formats ADD D AC ← AC + M [ D ]
l 1) Operation Code Field : specify the operation to be performed MUL T AC ← AC ∗ M [T ]
l 2) Address Field : designate a memory address or a processor register STORE X M [ X ] ← AC
l 3) Mode Field : specify the operand or the effective address (Addressing Mode)
» All operations are done between the AC register and memory operand
Computer System Architecture Chap. 8 Central Processing Unit Computer System Architecture Chap. 8 Central Processing Unit
3. 8-4. Instruction Formats 9 / 22 8-5. Addressing Modes 11 / 22
l 4) Zero-Address Instruction u Program Counter (PC)
PUSH A TOS ← A
l PC keeps track of the instructions in the program stored in memory
PUSH B TOS ← B
l PC holds the address of the instruction to be executed next
ADD TOS ← ( A + B )
l PC is incremented each time an instruction is fetched from memory
PUSH C TOS ← C
u Addressing Mode of the Instruction
PUSH D TOS ← D
l 1) Distinct Binary Code
ADD TOS ← (C + D )
» Instruction Format 에 Opcode 와 같이 별도에 Addressing Mode Field를 갖고 있음
MUL TOS ← (C + D ) ∗ ( A + B )
l 2) Single Binary Code
POP X M [ X ] ← TOS
» Instruction Format에 Opcode 와 Addressing Mode Field가 섞여 있음
» Stack-organized computer does not use an address field for the instructions ADD, and
u Instruction Format with mode field : Fig. 8-6
MUL
» PUSH, and POP instructions need an address field to specify the operand Opcode Mode Address
» Zero-Address : absence of address ( ADD, MUL )
u RISC Instruction u Implied Mode
l Only use LOAD and STORE instruction when communicating between memory l Operands are specified implicitly in definition of the instruction
and CPU l Examples
l All other instructions are executed within the registers of the CPU without » COM : Complement Accumulator
referring to memory n Operand in AC is implied in the definition of the instruction
l RISC architecture will be explained in Sec. 8-8 » PUSH : Stack push
n Operand is implied to be on top of the stack
Computer System Architecture Chap. 8 Central Processing Unit Computer System Architecture Chap. 8 Central Processing Unit
8-5. Addressing Modes 10 / 22 8-5. Addressing Modes 12 / 22
l Program to evaluate X = ( A + B ) * ( C + D ) u Immediate Mode
LOAD R1, A R1 ← M [ A] l Operand field contains the actual operand
LOAD R2, B R2 ← M [B] l Useful for initializing registers to a constant value
LOAD R3, C R 3 ← M [C ] l Example : LD #NBR
LOAD R4, D R4 ← M [D ]
u Register Mode
ADD R1, R1, R2 R1 ← R1 + R 2
l Operands are in registers
ADD R3, R3, R4 R3 ← R3 + R4
l Register is selected from a register field in the instruction
MUL R1, R1, R3 R1 ← R1 ∗ R 3
» k-bit register field can specify any one of 2k registers
STORE X, R1 M [ X ] ← R1
l Example : LD R1 AC ← R1 Implied Mode
n 8-5 Addressing Modes u Register Indirect Mode
l Selected register contains the address of the operand rather than the operand
u Addressing Mode의 필요성
itself
l 1) To give programming versatility to the user
l : Address field of the instruction uses fewer bits to select a memory address
» pointers to memory, counters for loop control, indexing of data, … .
» Register 를 select 하는 것이 bit 수가 적게 소요됨
l 2) To reduce the number of bits in the addressing field of the instruction
l Example : LD (R1) AC ← M [R1]
u Instruction Cycle
u Autoincrement or Autodecrement Mode
l 1) Fetch the instruction from memory and PC + 1
l Similar to the register indirect mode except that
l 2) Decode the instruction
» the register is incremented after its value is used to access memory
l 3) Execute the instruction » the register is decrement before its value is used to access memory
Computer System Architecture Chap. 8 Central Processing Unit Computer System Architecture Chap. 8 Central Processing Unit
4. 8-5. Addressing Modes 13 / 22 8-6. Data Transfer and Manipulation 15 / 22
l Example (Autoincrement) : LD (R1)+ AC ← M [ R1], R1 ← R1 + 1
n 8-6 Data Transfer and Manipulation
u Direct Addressing Mode
u Most computer instructions can be classified into three categories:
l Effective address is equal to the address field of the instruction (Operand)
l 1) Data transfer, 2) Data manipulation, 3) Program control instructions
l Address field specifies the actual branch address in a branch-type instruction
u Data Transfer Instruction
l Example : LD ADR AC ← M [ ADR ]
ADR = Address part of Instruction l Typical Data Transfer Instruction : Tab. 8-5
u Indirect Addressing Mode
» Load : transfer from memory to a processor register, usually an AC (memory read)
l Address field of instruction gives the address where the effective address is » Store : transfer from a processor register into memory (memory write)
stored in memory » Move : transfer from one register to another register
l Example : LD @ADR AC ← M [ M [ ADR ]] » Exchange : swap information between two registers or a register and a memory word
u Relative Addressing Mode » Input/Output : transfer data among processor registers and input/output device
l PC is added to the address part of the instruction to obtain the effective address
» Push/Pop : transfer data between processor registers and a memory stack
l Example : LD $ADR AC ← M [ PC + ADR ] l 8 Addressing Mode for the LOAD Instruction : Tab. 8-6
» @ : Indirect Address
u Indexed Addressing Mode
» $ : Address relative to PC
l XR (Index register) is added to the address part of the instruction to obtain the » # : Immediate Mode
effective address » ( ) : Index Mode, Register Indirect, Autoincrement 에서 register 지정
l Example : LD ADR(XR) AC ← M [ ADR + XR ]
u Data Manipulation Instruction
u Base Register Addressing Mode Not Here l 1) Arithmetic, 2) Logical and bit manipulation, 3) Shift Instruction
l the content of a base register is added to the address part of the instruction to
obtain the effective address
Computer System Architecture Chap. 8 Central Processing Unit Computer System Architecture Chap. 8 Central Processing Unit
8-5. Addressing Modes 14 / 22 8-7. Program Control 16 / 22
l Similar to the indexed addressing mode except that the register is now called a l Arithmetic Instructions : Tab. 8-7
base register instead of an index register
l Logical and Bit Manipulation Instructions : Tab. 8-8
» index register (XR) : LD ADR(XR) AC ← M [ ADR + XR ] ADR 기준
n index register hold an index number that is relative to the address part of the instruction l Shift Instructions : Tab. 8-9
» base register (BR) : LD ADR(BR) AC ← M [ BR + ADR ] BR 기준 n 8-7 Program Control
n base register hold a base address
n the address field of the instruction gives a displacement relative to this base address u Program Control Instruction : Tab. 8-10
Address Memory l Branch and Jump instructions are used interchangeably to mean the same thing
u Numerical Example
PC = 200 200 Load to AC Mode
Addressing Mode Effective Address Content of AC u Status Bit Conditions : Fig. 8-8
201 Address = 500
Immediate Address Mode 201 500
l Condition Code Bit or Flag Bit
Direct Address Mode 500 800 R1 = 400 202 Next instruction
Indirect Address Mode 800 300 » The bits are set or cleared as a result of an operation performed in the ALU
Register Mode 400 u 4-bit status register
XR = 100
Register Indirect Mode 400 700
Relative Address Mode 702 325 399 450 l Bit C (carry) : set to 1 if the end carry C8 is 1
Indexed Address Mode 600 900 AC 400 700 l Bit S (sign) : set to 1 if F7 is 1
Autoincrement Mode 400 700
u
Autodecrement Mode 399 450 500 800 l Bit Z (zero) : set to 1 if the output of the ALU contains all 0’
s
R1 = 400 l Bit V (overflow) : set to 1 if the exclusive-OR of the last two carries (C8 and C7) is
600 900 equal to 1
500 + 202 (PC)
R1 = 400 (after) l Flag Example : A - B = A + ( 2’ Comp. Of B ) : A =11110000, B = 00010100
s
702 325
500 + 100 (XR) 11110000
R1 = 400 -1 (prior)
+ 11101100 (2’ comp. of B)
s C = 1, S = 1, V = 0, Z = 0
800 300
1 11011100
Computer System Architecture Chap. 8 Central Processing Unit Computer System Architecture Chap. 8 Central Processing Unit
5. 8-7. Program Control 17 / 22 8-8. Reduced Instruction Set Computer (RISC) 19 / 22
u Conditional Branch : Tab. 8-11 n 8-8 Reduced Instruction Set Computer (RISC)
u Subroutine Call and Return u Complex Instruction Set Computer (CISC)
l CALL : SP ← SP − 1 : Decrement stack point l Major characteristics of a CISC architecture
M [ SP ] ← PC : Push content of PC onto the stack » 1) A large number of instructions - typically from 100 to 250 instruction
PC ← Effective Address : Transfer control to the subroutine » 2) Some instructions that perform specialized tasks and are used infrequently
l RETURN : PC ← M [ SP ] : Pop stack and transfer to PC » 3) A large variety of addressing modes - typically from 5 to 20 different modes
» 4) Variable-length instruction formats
SP ← SP + 1 : Increment stack pointer
» 5) Instructions that manipulate operands in memory (RISC 에서는 in register)
u Program Interrupt
u Reduced Instruction Set Computer (RISC)
l Program Interrupt
l Major characteristics of a RISC architecture
» Transfer program control from a currently running program to another service program
as a result of an external or internal generated request » 1) Relatively few instructions
» Control returns to the original program after the service program is executed » 2) Relatively few addressing modes
» 3) Memory access limited to load and store instruction
l Interrupt Service Program 과 Subroutine Call 의 차이점
» 4) All operations done within the registers of the CPU
» 1) An interrupt is initiated by an internal or external signal (except for software interrupt)
» 5) Fixed-length, easily decoded instruction format
n A subroutine call is initiated from the execution of an instruction (CALL)
» 2) The address of the interrupt service program is determined by the hardware » 6) Single-cycle instruction execution
n The address of the subroutine call is determined from the address field of an instruction » 7) Hardwired rather than microprogrammed control
» 3) An interrupt procedure stores all the information necessary to define the state of the
CPU
n A subroutine call stores only the program counter (Return address)
Computer System Architecture Chap. 8 Central Processing Unit Computer System Architecture Chap. 8 Central Processing Unit
8-7. Program Control 18 / 22 8-8. Reduced Instruction Set Computer (RISC) 20 / 22
l Program Status Word (PSW) l Other characteristics of a RISC architecture
External Int.
» The collection of all status bit conditions in the CPU Interrupt » 1) A relatively large number of registers in the processor unit
Internal Int.
Detect » 2) Use of overlapped register windows to speed-up procedure call and return
l Two CPU Operating Modes Software Int.
» Supervisor (System) Mode : Privileged Instruction 실행 » 3) Efficient instruction pipeline
n When the CPU is executing a program that is part of Determine the » 4) Compiler support for efficient translation of high-level language programs into
the operating system address of ISR machine language programs R15
» User Mode : User program 실행 PC, CPU Register, Status Condition Common to D and A
Circular Window
u Overlapped Register Windows R10
n When the CPU is executing an user program Store Information
R73
CPU operating mode is determined from special bits in the PSW l Time consuming operations during procedure call Local to D
R64
» Saving and restoring registers R63
Common to C and D
u Types of Interrupts Main body of ISR » Passing of parameters and results R58
R57
Proc D
l 1) External Interrupts ISR l Overlapped Register Windows Local to C
» come from I/O device, from a timing device, from a circuit » Provide the passing of parameters and avoid the need R48
R47
monitoring the power supply, or from any other external source
Restore Information for saving and restoring register values by hardware Common to B and C
R42
l 2) Internal Interrupts or TRAP u Concept of overlapped register windows : Fig. 8-9 Proc C R41
Local to B
Interrupt
» caused by register overflow, attempt to divide by zero, Return l Total 74 registers : R0 - R73 R32
R31
Common to A and B
an invalid operation code, stack overflow, and protection violation » R0 - R9 : Global registers
R26
l 3) Software Interrupts » R10 - R63 : 4 windows Proc B R25
Local to A
» initiated by executing an instruction (INT or RST) n Window A
10 Local registers
R16
R9 R15
» used by the programmer to initiate an interrupt procedure at any desired point in the n Window B
+
C o m m o n to all Common to A and D
Procedures
n Window C
program 2 sets of 6 registers R0
Global
R10
Proc A
n Window D (common to adjacent windows) registers
Computer System Architecture Chap. 8 Central Processing Unit Computer System Architecture Chap. 8 Central Processing Unit
6. 8-8. Reduced Instruction Set Computer (RISC) 21 / 22
l Example) Procedure A calls procedure B
» R26 - R31
n Store parameters for procedure B
n Store results of procedure B
» R16 - R25 : Local to procedure A
» R32 - R41 : Local to procedure B
l Window Size = L + 2C + G = 10 + ( 2 X 6 ) + 10 = 32 registers
l Register File (total register) = (L + C) X W + G = (10 + 6 ) X 4 + 10 = 74 registers
» 여기서, G : Global registers = 10
L : Local registers = 10
C : Common registers = 6
W : Number of windows = 4
u Berkeley RISC I
l RISC Architecture 의 기원 : 1980 년대 초
» Berkeley RISC project : first project = Berkeley RISC I
» Stanford MIPS project
l Berkeley RISC I
» 32 bit CPU, 32 bit instruction format, 31 instruction
» 3 addressing modes : register, immediate, relative to PC
Computer System Architecture Chap. 8 Central Processing Unit
8-8. Reduced Instruction Set Computer (RISC) 22 / 22
l Instruction Set : Tab. 8-12
l Instruction Format : Fig. 8-10 31 24 23 19 18 14 13 12 5 4 0
l Register Mode : bit 13 = 0 Opcode Rd Rs 0 Not used S2
» S2 = register 8 5 5 1 8 5
» Example) ADD R22, R21, R23 (a) Register mode : (S2 specifies a register)
n ADD Rs, S2, Rd : Rd = Rs + S2
l Register Immediate Mode : bit 13 = 1 31 24 23 19 18 14 13 12 0
Opcode Rd Rs 1 S2
» S2 = sign extended 13 bit constant
8 5 5 1 13
» Example) LDL (R22)#150, R5
n LDL (Rs)S2, Rd : Rd = M[R22] + 150 (b) Register-immediate mode : (S2 specifies an operand)
l PC Relative Mode
31 24 23 19 18 0
» Y = 19 bit relative address Opcode COND Y
» Example) JMPR COND, Y 8 5 19
n Jump to PC = PC + Y
» CWP (Current Window Pointer) (c) PC relative mode :
n CALL, RET시 stack pointer 같이 사용됨
l RISC Architecture Originator
Architecture Originator Licensees
Alpha DEC Mitsubishi, Samsung
MIPS MIPS Technologies NEC, Toshiba
PA-RISC Hewlett Packard Hitachi, Samsung
PowerPC Apple, IBM, Motorola Bul r p
Sparc Sun Fujitsu, Hyundai
i960 Intel Intel only (Embedded Controller)
Computer System Architecture Chap. 8 Central Processing Unit