40
Microprocessors Systems: Microprocessors Systems: Solutions manual to Solutions manual to selected exercises selected exercises Mile Stojcev, Tatjana Mile Stojcev, Tatjana Stankovic Stankovic

Microprocessors Systems: Solutions manual to selected exercises Mile Stojcev, Tatjana Stankovic

Embed Size (px)

Citation preview

Microprocessors Systems:Microprocessors Systems: Solutions manual to selected Solutions manual to selected

exercisesexercises

Mile Stojcev, Tatjana Stankovic Mile Stojcev, Tatjana Stankovic

20752075Microprocessor systemsMicroprocessor systems

Directions: Directions: - Electronics, - Electronics,

- Communications, - Communications,

- Microelectronics- Microelectronics

VII semester 2+2+1 VII semester 2+2+1

VIII semester 2+2+1VIII semester 2+2+1

20752075Microprocessor systemsMicroprocessor systems

There are probably almost as many different curricula and There are probably almost as many different curricula and syllabi for microprocessor system design as there are syllabi for microprocessor system design as there are schools and instructors in which the subject is taught.schools and instructors in which the subject is taught.

The proposed course is suitable for an introduction on The proposed course is suitable for an introduction on microprocessor system design at the junior or senior microprocessor system design at the junior or senior level, or at an advanced sophomore level.level, or at an advanced sophomore level.

20752075Microprocessor systemsMicroprocessor systems

Goal of the course:Goal of the course:

Microprocessor systems are extremely complex systems Microprocessor systems are extremely complex systems consisting of many components whose operation depends consisting of many components whose operation depends on many factors. on many factors.

In order to understand microprocessor systems it is essential In order to understand microprocessor systems it is essential that a student should be exposed to the concept of levels in that a student should be exposed to the concept of levels in computer architecture. It allows them to see how various computer architecture. It allows them to see how various parts of the microprocessor system fit into one whole.parts of the microprocessor system fit into one whole.

At the beginning of the course the concept of levels are At the beginning of the course the concept of levels are presented to students.presented to students.

20752075Microprocessor systemsMicroprocessor systems

Goal of the course (continued):Goal of the course (continued):

The students then have a context in which to place various The students then have a context in which to place various topics as they progress through the course. topics as they progress through the course.

The course attempts to provide a balanced view of all The course attempts to provide a balanced view of all important elements of microprocessor system design. important elements of microprocessor system design.

It is organized so that all the relevant topics are covered at It is organized so that all the relevant topics are covered at some medium essential level of detail. some medium essential level of detail.

Additional material is provided to students, in order to Additional material is provided to students, in order to overcome certain topics in greater depth. overcome certain topics in greater depth.

20752075Microprocessor systemsMicroprocessor systems

Needed prerequisites:Needed prerequisites:

On assume that the student had at least an introductory course in some:On assume that the student had at least an introductory course in some:

High-level programming language such as C, Java, or Pascal,High-level programming language such as C, Java, or Pascal,

One/two semesters of digital logic design.One/two semesters of digital logic design.

Many students who have taken a course in digital logic design need to Many students who have taken a course in digital logic design need to renovate the knowledge concerning synthesis of: renovate the knowledge concerning synthesis of:

FSMs, FSMs,

PLDs (CPLDs & FPGAs), and PLDs (CPLDs & FPGAs), and

VHDL as a tool for designing, implementing, and testing complex VHDL as a tool for designing, implementing, and testing complex systems. systems.

20752075Microprocessor systemsMicroprocessor systems

Organization:Organization:

We have organized a course so that all relevant topics are We have organized a course so that all relevant topics are covered in two semesters with a fund of 2+2+1.covered in two semesters with a fund of 2+2+1.

The complete course is composed of:The complete course is composed of:

a) 60 classes of teaching; 30 classes per semester, two a) 60 classes of teaching; 30 classes per semester, two classes per weekclasses per week

b) 60 classes of oral exercises and working in projects; 30 b) 60 classes of oral exercises and working in projects; 30 classes per semester, two classes per weekclasses per semester, two classes per week

c) 30 classes of lab exercises; 15 classes per semester, c) 30 classes of lab exercises; 15 classes per semester, one class per week.one class per week.

20752075Microprocessor systemsMicroprocessor systems

Required course material:Required course material:1)1) RISC, CISC and DSP processorsRISC, CISC and DSP processors

Faculty of Electronic Engineering Nis, 1997.Faculty of Electronic Engineering Nis, 1997.Mile StojcevMile Stojcev

2)2) Architectures and Programming of Microcomputer Systems Based on Architectures and Programming of Microcomputer Systems Based on IA32IA32Faculty of Electronic Engineering Nis, 2000.Faculty of Electronic Engineering Nis, 2000.Mile Stojcev, Branislav PetrovicMile Stojcev, Branislav Petrovic

3)3) Solution Manual to accompany Microprocessor and MicrocomputerSolution Manual to accompany Microprocessor and MicrocomputerFaculty of Electronic Engineering Nis, 1999.Faculty of Electronic Engineering Nis, 1999.Mile Stojcev, Sasa Ristic, Milos KrsticMile Stojcev, Sasa Ristic, Milos Krstic

4)4) Microprocessors Systems: Solutions manual to selected exercisesMicroprocessors Systems: Solutions manual to selected exercisesFaculty of Electronic Engineering Nis, 2003.Faculty of Electronic Engineering Nis, 2003.Mile Stojcev, Tatjana StankovicMile Stojcev, Tatjana Stankovic

20752075Microprocessor systemsMicroprocessor systems

Evolution of microprocessor systems:Evolution of microprocessor systems:

- Earlier generations of microprocessors had almost trivial - Earlier generations of microprocessors had almost trivial internal structure. internal structure.

- Present designs contain multiple pipelined functional unit - Present designs contain multiple pipelined functional unit with support for multiple processor and memories.with support for multiple processor and memories.

20752075Microprocessor systemsMicroprocessor systems

Evolution of microprocessor systems (continued):Evolution of microprocessor systems (continued):The appropriate topics for such a course have changed The appropriate topics for such a course have changed

considerably in recent years. considerably in recent years. The topics of: The topics of:

- pipelined processor design, - pipelined processor design, - the memory hierarchy, and - the memory hierarchy, and - networks - networks

are moving to the center stage in the arena of microprocessor are moving to the center stage in the arena of microprocessor system design.system design.

20752075Microprocessor systemsMicroprocessor systems

Main topics:Main topics:

Quantitative performance evaluations at both the component Quantitative performance evaluations at both the component and system level, where:and system level, where:- total time to execute a program,- total time to execute a program,- silicon area, - silicon area, - or other hardware/software tradeoffs- or other hardware/software tradeoffs

are considered as dominant performance measures. are considered as dominant performance measures.

20752075Microprocessor systemsMicroprocessor systems

Main topics (continued):Main topics (continued):

Instruction Set Architecture (ISA) of a microprocessor is Instruction Set Architecture (ISA) of a microprocessor is involved.involved.

The tasks that microprocessor performs are determined.The tasks that microprocessor performs are determined.

Instructions, internal registers, and other ISA components Instructions, internal registers, and other ISA components are specified.are specified.

20752075Microprocessor systemsMicroprocessor systems

Main topics (continued):Main topics (continued):

Register-Transfer-Level (RTL) treatment of the Register-Transfer-Level (RTL) treatment of the implementation of instruction fetching and execution in a implementation of instruction fetching and execution in a processor is considered. processor is considered.

This is followed by a discussion of processor implementation This is followed by a discussion of processor implementation by both hardwired and microprogrammed approaches. by both hardwired and microprogrammed approaches.

20752075Microprocessor systemsMicroprocessor systems

Main topics (continued):Main topics (continued):

Memory system is treated.Memory system is treated.Caches and multiple module memory systems are explained Caches and multiple module memory systems are explained

as ways for increasing main memory bandwidth.as ways for increasing main memory bandwidth.Caches are discussed in some details including performance Caches are discussed in some details including performance

modeling.modeling.Virtual memory systems and memory management are also Virtual memory systems and memory management are also

presented. presented.

20752075Microprocessor systemsMicroprocessor systems

Main topics (continued):Main topics (continued):

A detailed coverage of the use of pipelining in the design of A detailed coverage of the use of pipelining in the design of high-performance microprocessors is presented. high-performance microprocessors is presented.

The role of the compiler and the relationship between The role of the compiler and the relationship between pipelined execution and instruction set design are explored. pipelined execution and instruction set design are explored.

20752075Microprocessor systemsMicroprocessor systems

Main topics (continued):Main topics (continued):

Instruction-Level-Parallelism (ILP) is considered.Instruction-Level-Parallelism (ILP) is considered.

The basics of superscalar and VLIW instruction processing by The basics of superscalar and VLIW instruction processing by the utilization of multiple functional units are also treated. the utilization of multiple functional units are also treated.

20752075Microprocessor systemsMicroprocessor systems

Main topics (continued):Main topics (continued):

Input/Output organization is considered. Input/Output organization is considered.

The basics of I/O data transfer synchronization are presented.The basics of I/O data transfer synchronization are presented.

Interrupts and direct-memory access methods are explained, Interrupts and direct-memory access methods are explained, including a discussion of the role of software interrupts in including a discussion of the role of software interrupts in operating systems. operating systems.

Bus protocols and standards are also presented.Bus protocols and standards are also presented.

20752075Microprocessor systemsMicroprocessor systems

Main topics (continued):Main topics (continued):

Communication cover network architectures, focusing on:Communication cover network architectures, focusing on:

- modems,- modems,

- local area networks (LANs),- local area networks (LANs),

- wide area networks (WANs).- wide area networks (WANs).

The emphasis is primarily on network architecture, with The emphasis is primarily on network architecture, with accessible discussions of protocols that spotlight key accessible discussions of protocols that spotlight key feature of network architecture. feature of network architecture.

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercisesMicroprocessors Systems: Solutions manual to selected exercises

contains 371 plus VII text pages of the B5 format, prepared on PC contains 371 plus VII text pages of the B5 format, prepared on PC machine intended for printing.machine intended for printing.

Structure:Structure:

The book is divided into four Chapters, section Bibliography with The book is divided into four Chapters, section Bibliography with 46 cited references, and one Appendix. 46 cited references, and one Appendix.

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected Microprocessors Systems: Solutions manual to selected exercises exercises

Chapter 1 – Chapter 1 – Written part of the exam testsWritten part of the exam testsExam exercises in the time period from January ’99 until Exam exercises in the time period from January ’99 until

June ’03 are presented. June ’03 are presented. In total there are: In total there are:

- 40 examination periods- 40 examination periods- 160 solved problems on 150 pages, including 52 - 160 solved problems on 150 pages, including 52 pictures and number of tables and short program pictures and number of tables and short program sequences.sequences.

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercises Microprocessors Systems: Solutions manual to selected exercises

Written part of the exam tests – Written part of the exam tests – LayoutLayout

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercises - Microprocessors Systems: Solutions manual to selected exercises - Written part of the exam tests Written part of the exam tests -- Layout Layout (cont.)(cont.)

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected Microprocessors Systems: Solutions manual to selected exercises - exercises - Written part of the exam tests Written part of the exam tests -- Layout Layout (cont.)(cont.)

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected Microprocessors Systems: Solutions manual to selected exercises - exercises - Written part of the exam tests Written part of the exam tests -- Layout Layout (cont.)(cont.)

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected Microprocessors Systems: Solutions manual to selected exercises - exercises - Written part of the exam tests Written part of the exam tests -- Layout Layout (cont.)(cont.)

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercises - Microprocessors Systems: Solutions manual to selected exercises - Written part of the exam tests Written part of the exam tests –– Criteria for evaluationCriteria for evaluation

- Each exam consists of four problems. - Each exam consists of four problems. - All problems are pointed equally. - All problems are pointed equally.

- Maximal number of points 100.- Maximal number of points 100.- Minimal number of points to pass the written part of the exam test is - Minimal number of points to pass the written part of the exam test is 50 points.50 points.

- Criteria for pointing problems:- Criteria for pointing problems:- correct answer 25 points- correct answer 25 points- correct answer but error in computing/program presentation 20 points- correct answer but error in computing/program presentation 20 points- correct idea and concept well defined, only, 15 points- correct idea and concept well defined, only, 15 points- correct idea but non optimal hardware-software solution 10 points- correct idea but non optimal hardware-software solution 10 points- correct idea but badly documented 5 points.- correct idea but badly documented 5 points.

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercises Microprocessors Systems: Solutions manual to selected exercises

Chapter 2 – Chapter 2 – Selected problemSelected problemCollection of distinctive problems from the field of computer architecture Collection of distinctive problems from the field of computer architecture

and organization. and organization. Hot topics refer to RISC processors, pipelining, superscalar, VLIW Hot topics refer to RISC processors, pipelining, superscalar, VLIW

concepts, ILP cash memory, etc. concepts, ILP cash memory, etc. In total there are: In total there are:

- 76 pages- 76 pages- 107 problems illustrated by 41 figures, a great number of tables and - 107 problems illustrated by 41 figures, a great number of tables and short program sequences.short program sequences.

The aim of the presented problems, is to, in an indirect way, bring closer The aim of the presented problems, is to, in an indirect way, bring closer and explain contemporary concepts of processing instructions. and explain contemporary concepts of processing instructions.

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercises Microprocessors Systems: Solutions manual to selected exercises

Chapter 2 – Chapter 2 – Selected problem Selected problem -- Typical problemTypical problem

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercises Microprocessors Systems: Solutions manual to selected exercises

Chapter 2 – Chapter 2 – Selected problem Selected problem -- Typical problemTypical problem – (cont.) – (cont.)

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercises Microprocessors Systems: Solutions manual to selected exercises

Chapter 2 – Chapter 2 – Selected problem Selected problem -- Typical problemTypical problem

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercises Microprocessors Systems: Solutions manual to selected exercises

Chapter 2 – Chapter 2 – Selected problem Selected problem -- Typical problem (solution)Typical problem (solution)

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercises Microprocessors Systems: Solutions manual to selected exercises Chapter 3 – Chapter 3 – Oral part of the examOral part of the exam

- 16 sets of questions- 16 sets of questions- totally 150 questions, presented on 14 pages- totally 150 questions, presented on 14 pages- the writing part consists of 10 questions selected from different topics- the writing part consists of 10 questions selected from different topics - criteria for evaluation- criteria for evaluation

- a correct answer to the question ……….. 1 point- a correct answer to the question ……….. 1 point- incomplete correct answer ………………. 0.7 point- incomplete correct answer ………………. 0.7 point- presentation of the main idea …………… 0.5 point- presentation of the main idea …………… 0.5 point- partially correct answer ………………….. 0.3 point- partially correct answer ………………….. 0.3 point- no answer ………………………………… -0.3 point- no answer ………………………………… -0.3 point- incorrect answer …………………………. -0.5 point- incorrect answer …………………………. -0.5 point- maximal number of points ……………… 10 points - maximal number of points ……………… 10 points - minimal number of points for pass ……… 5 points- minimal number of points for pass ……… 5 points- final number of points is determined as arithmetic means of the - final number of points is determined as arithmetic means of the

written written and oral parts of the exam.and oral parts of the exam.

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercises Microprocessors Systems: Solutions manual to selected exercises

Chapter 3 - Chapter 3 - Oral part of the exam Oral part of the exam -- Layout of a typical setLayout of a typical set

1)1) Describes the differences between a Describes the differences between a traptrap instruction and a instruction and a subroutine callsubroutine call..

2)2) Concerning disc, define the terms Concerning disc, define the terms seek timeseek time, , rotational delayrotational delay, , access timeaccess time, and , and transfer timetransfer time. .

3)3) What is the difference between DRAM and SRAM in terms of What is the difference between DRAM and SRAM in terms of characteristic such as characteristic such as speedspeed, , sizesize, and , and costcost??

4)4) What is the distinction between What is the distinction between spatial localityspatial locality and and temporal localitytemporal locality??

5)5) What are the typical elements of a What are the typical elements of a machine instructionmachine instruction??

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercises Microprocessors Systems: Solutions manual to selected exercises

Chapter 3 - Chapter 3 - Oral part of the exam Oral part of the exam -- Layout of a typical set (cont.)Layout of a typical set (cont.)

6)6) What is the distinction between What is the distinction between instruction level parallelisminstruction level parallelism and and machine parallelismmachine parallelism??

7)7) What is the difference between a What is the difference between a hardware pipelinehardware pipeline and a and a software software pipelinepipeline? ?

8)8) What is the difference between What is the difference between horizontal microinstructionhorizontal microinstruction and and vertical microinstructionvertical microinstruction??

9)9) Briefly define Briefly define indirect addressingindirect addressing..

10)10) What are the advantages of the What are the advantages of the geometric meangeometric mean over the over the harmonicharmonic and and arithmetic meansarithmetic means when combining normalized execution rates? when combining normalized execution rates?

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercises Microprocessors Systems: Solutions manual to selected exercises Chapter 4 – Chapter 4 – Selected test problemsSelected test problems

- 555 different selected test problems- 555 different selected test problems- given in 119 pages- given in 119 pages- depending on how a problem difficult is, the questions are divided into - depending on how a problem difficult is, the questions are divided into three groups:three groups:

- standard questions, devoted to everyone, are not marked - standard questions, devoted to everyone, are not marked - questions which the students should know if they want to get - questions which the students should know if they want to get

a a higher mark (>8) are marked with one asterisk higher mark (>8) are marked with one asterisk - difficult questions, intended for graduate students, are - difficult questions, intended for graduate students, are

marked marked with two asterisks.with two asterisks.

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected Microprocessors Systems: Solutions manual to selected exercises exercises

Chapter 4 – Chapter 4 – Selected test problems Selected test problems -- Layout of standard Layout of standard questionsquestions

- What types of locations can hold source and destination What types of locations can hold source and destination operands?operands?

- What is a difference between big endian and little endian?What is a difference between big endian and little endian?- What general roles are performed by CPU registers?What general roles are performed by CPU registers?- What is a program status word?What is a program status word?- Give a simple definition of precise interrupts/exceptions?Give a simple definition of precise interrupts/exceptions?

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected exercises Microprocessors Systems: Solutions manual to selected exercises Chapter 4 – Chapter 4 – Selected test problems Selected test problems -- Layout of questions marked with Layout of questions marked with

one asteriskone asterisk

- Define the crucial differences between microcontrollers and Define the crucial differences between microcontrollers and microprocessors? microprocessors?

- Explain the differences among the following program defined Explain the differences among the following program defined exceptions:exceptions:

a) illegal instructiona) illegal instructionb) non-implemented instructionb) non-implemented instructionc) privileged instructionc) privileged instructiond) arithmetic error.d) arithmetic error.

For the example of a conditional jump statement For the example of a conditional jump statement if C then I1 else I2if C then I1 else I2

explain the concepts of branch prediction and speculative execution.explain the concepts of branch prediction and speculative execution.

20752075Microprocessor systemsMicroprocessor systems

Microprocessors Systems: Solutions manual to selected Microprocessors Systems: Solutions manual to selected exercises exercises

Chapter 4 – Chapter 4 – Selected test problems Selected test problems -- Layout of questions Layout of questions marked with two asterisksmarked with two asterisks

- Define the basic characteristics of the following benchmark programs: Define the basic characteristics of the following benchmark programs: DhrystoneDhrystone, , WhetstoneWhetstone, , Livermore LoopsLivermore Loops, and , and LinpackLinpack..

- Define briefly what kind of relationship exists between the Define briefly what kind of relationship exists between the sequential sequential model of executionmodel of execution and the and the precise processor stateprecise processor state. .

- What kind of similar and conceptually different activities perform the What kind of similar and conceptually different activities perform the linkerlinker and and loaderloader? ?

20752075Microprocessor systemsMicroprocessor systems

As conclusionAs conclusion

Microprocessors Systems:Microprocessors Systems: Solutions manual to selected Solutions manual to selected exercisesexercises, by M. Stojcev and T. Stankovic, , by M. Stojcev and T. Stankovic,

published by Faculty of Electronic Engineering Nis 2004. published by Faculty of Electronic Engineering Nis 2004. contains a collection of problems and theoretical questions, contains a collection of problems and theoretical questions, useful to students for preparing the major Microprocessor useful to students for preparing the major Microprocessor systems exams, and at the same time shows new trends of systems exams, and at the same time shows new trends of development in the field of computer architecture.development in the field of computer architecture.

20752075Microprocessor systemsMicroprocessor systems

Thanks to all for stated attention and patience Thanks to all for stated attention and patience to follow this presentation!to follow this presentation!