D75P 34 – HNC Computer Architecture Lecture 14 Clock Cycles and Program Analysis. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College.

Slides:



Advertisements
Similar presentations
The 8051 Microcontroller and Embedded Systems
Advertisements

The Central Processing Unit (CPU) Understanding Computers.
Chapter 2 Machine Language.
D75P 34 – HNC Computer Architecture Week 4 Reading and writing to RAM. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except where.
The 8085 Microprocessor Architecture
1 Microprocessor History. 2 The date is the year that the processor was first introduced. Many processors are re- introduced at higher clock speeds for.
The Little man computer
DH2T 34 Computer Architecture 1 LO2 Lesson Two CPU and Buses.
Processor Technology and Architecture
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Copyright © 1998 Wanda Kunkle Computer Organization 1 Chapter 2.1 Introduction.
Chapter 4 Assessing and Understanding Performance
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
Lecture 3: Computer Performance
Operating Systems Lecture 1 Crucial hardware concepts review M. Naghibzadeh Reference: M. Naghibzadeh, Operating System Concepts and Techniques, iUniverse.
Computer Applications NCBS Stage 1. The Central Processing UnitSlide 2Computer Applications Stage 1 Course Content and Assessment Practical – 60% (2 Hrs.
The CPU The Central Presentation Unit Language Levels Fetch execute cycle Processor speed.
A-Level Computing#BristolMet Session Objectives#4 MUST describe the differences between the main types of primary memory SHOULD describe the function and.
AERIALS AND RADIO FREQUENCY PROPAGATION By Farhan Saeed.
Computer Systems Computer Performance.
M206 – Data Measurement. Introduction ‘Have you ever wondered how the computer interprets data?’ This is the language that the computer understands. This.
Inside The CPU. Buses There are 3 Types of Buses There are 3 Types of Buses Address bus Address bus –between CPU and Main Memory –Carries address of where.
Group 5 Alain J. Percial Paula A. Ortiz Francis X. Ruiz.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Computer Systems 1 Fundamentals of Computing The CPU & Von Neumann.
Lecture#14. Last Lecture Summary Memory Address, size What memory stores OS, Application programs, Data, Instructions Types of Memory Non Volatile and.
Higher Computing Computer structure. What we need to know! Detailed description of the purpose of the ALU and control unitDetailed description of the.
Computer Processing of Data
Technology in Focus: Under the Hood
 Design model for a computer  Named after John von Neuman  Instructions that tell the computer what to do are stored in memory  Stored program Memory.
D75P 34R HNC Computer Architecture 1 Week 9 The Processor, Busses and Peripherals © C Nyssen/Aberdeen College 2003 All images © C Nyssen /Aberdeen College.
RM2D Let’s write our FIRST basic SPIN program!. The Labs that follow in this Module are designed to teach the following; Turn an LED on – assigning I/O.
IT253: Computer Organization Lecture 10: Making a Processor: Control Signals Tonga Institute of Higher Education.
Intermediate 2 Computing Computer structure. Organisation of a simple computer.
What have mr aldred’s dirty clothes got to do with the cpu
D75P 34 – HNC Computer Architecture Interim Week Hexadecimal revisited! © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except.
10/19/2015Erkay Savas1 Performance Computer Architecture – CS401 Erkay Savas Sabanci University.
Performance David Monismith Jan. 16, 2015 Based on notes from Dr. Bill Siever and from the Patterson and Hennessy Text.
Performance.
Computer Systems Week 7: Looping and Input/Output with 3-bit Alma Whitfield.
D75P 34 – HNC Computer Architecture Week 1 Main Components Of A Processor © C Nyssen/Aberdeen College 2003 All images © C Nyssen /Aberdeen College unless.
D75P 34 – HNC Computer Architecture Week 5 Memory Maps. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except where stated Prepared.
Timers and Interrupts Anurag Dwivedi. Let Us Revise.
DH2T 34 – HNC Computer Architecture 1 Lecture 14 The Fetch-Decode-Execute Cycle [1]. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College.
Computer Hardware The Processing Unit.
1 System Clock and Clock Synchronization.. System Clock Background Although modern computers are quite fast and getting faster all the time, they still.
D75P 34 – HNC Computer Architecture
IT253: Computer Organization Lecture 9: Making a Processor: Single-Cycle Processor Design Tonga Institute of Higher Education.
Stored Programs In today’s lesson, we will look at: what we mean by a stored program computer how computers store and run programs what we mean by the.
PC Start-up Procedure and Timing Lesson 6.  Hand in assignment from yesterday.  Describe the two main computer buses.  Describe how cache memory works.
The Central Processing Unit (CPU)
Session 4 Teaching Computing to GCSE Level with Python.
Chapter 4. Measure, Report, and Summarize Make intelligent choices See through the marketing hype Understanding underlying organizational aspects Why.
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
1 How will execution time grow with SIZE? int array[SIZE]; int sum = 0; for (int i = 0 ; i < ; ++ i) { for (int j = 0 ; j < SIZE ; ++ j) { sum +=
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
PROPERTIES OF WAVES. Waves A wave is a means of transferring energy and information from one point to another without there being any transfer of matter.
What’s going on here? Can you think of a generic way to describe both of these?
Computer Hardware What is a CPU.
GCSE OCR Computing A451 The CPU Computing hardware 1.
The Little man computer
The Central Processing Unit (CPU)
Chapter 2.1 CPU.
Edexcel GCSE Computer Science Topic 15 - The Processor (CPU)
THE CPU i Bytes 1.1.
Central Processing Unit
Objectives Describe how common characteristics of CPUs affect their performance: clock speed, cache size, number of cores Explain the purpose and give.
Course Code 114 Introduction to Computer Science
Presentation transcript:

D75P 34 – HNC Computer Architecture Lecture 14 Clock Cycles and Program Analysis. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except where stated Time, radio tower, computer all © Keyclip, with non-distribution licence Prepared 14/01/04

Let’s begin by reviewing the CPU from Outcome 2. We saw that the CU contained a system clock, made from a silicon crystal vibrating at very high speeds. The Control Unit uses the “ticks” of this clock to time the signals sent along the Control Bus. The faster the clock ticks, the more signals are sent, enabling the processing to be completed more quickly.

Frequency is measured in Hertz, named after the German physicist Heinrich Hertz, who made the sensational discovery of radio waves in Hz = 1 wavelength, pulse or vibration per second. In the UK, mains electric power runs at 50 Hz AC – the polarity of the current reverses 50 times per second. An early 486 computer had a processor running at 4 MHz – the system clock “ticked” 4,000,000 times per second.

Now is a good time to revise BIG numbers ….. 1 KiloHertz (kHz) = 1,000 Hz 1 MegaHertz (mHz) = 1,000,000 Hz 1 GigaHertz (gHz) = 1,000,000,000 Hz 1 TeraHertz (tHz) = 1,000,000,000,000 Hz 1 PetaHertz (pHz) = 1,000,000,000,000,000 Hz Note that when measuring Hertz, the definitions rise in value by 1000x each time. This is NOT the same as measuring bytes, where the definitions rise in value by 1024x each time! For assessment purposes you should concentrate on the values of the Mega- (million) and Giga- (billion) hertz.

We have already seen that the CU sends control signals based on the frequency of the internal clock. We can use the quoted speed, or frequency, of the processor, to work out how long the space is between each clock “tick”. For a 1 mHz processor, each clock “tick”, or cycle, will take 1 1,000,000second An alternative (better) method of writing this is second, or 1 x seconds.

A 1 gHz processor takes for each clock cycle This can also be expressed as 1 1,000,000,000second second, or 1 x 10 –9 second. This period of time is referred to a t- cycle. This in turn gives us a unit of measurement, when determining how long a program will take to run.

Some processor instructions are more difficult to execute than others, so it may take several t-cycles to fetch and execute the command. For assessment purposes, you will be given a chart showing how many t-cycles each assembly instruction will take to execute. Every time a t-cycle is generated, the Control Unit sends signals along the Control Bus to change the bit patterns in the registers and RAM.

To do a mov takes 10 t-cycles, the int takes 52 but the cmp, being a very simple task, only uses 4.

The first thing to establish is how many t-cycles each instruction uses. You can write it next to the source code like this -

Every computer program consists of three distinct parts :- We now have to split our program into the three sections, so that we know which lines may be repeated.

The first clue as to where the loop may lie is given in the two highlighted lines - The je is a conditional jump, so the program flow will either branch or keep going. Although jne is normally conditional, in this case it acts as though it were an unconditional jump.

Everything in the red box will happen in the context of one complete loop. This also shows us what happens once only before and after the loop.

We can now begin to calculate the total number of t-cycles required using the following formula – Total t-cycles = t-cycles at start + t-cycles at end + t-cycles in each complete loop x number of loops t-cycles in last loop (which may be only a partial loop)

Note that je and jne have two values, because they are condition statements. It is a lot harder for the processor to work out what to do, if the program has to jump, so the higher number would be used. If, however, the condition is not met and the program flow is not going to branch off, the lower value is used. So the number of t-cycles required for each complete loop will be (not jumping) (jump back to start) = 84.

On the last iteration of the loop, where the stopping condition is met, the number of t-cycles will be (jump to exit) = 76. We can now begin to fill in the formula - Total t-cycles = t-cycles at start + 72 t-cycles at end + 62 t-cycles in each complete loop x number of loops 84 x ? t-cycles in last loop (which may be only a partial loop) 76

The only figure now missing is for how many complete loops are run. To establish this, we have to look at the data provided. We are told that the user inputs the following values each time the prompt is displayed – 6, o, %, f and s One of the stopping conditions was defined in the lines So the condition is met on the fifth pass of the loop.

Remember that on the fifth pass, the loop is only the partial one, as the stopping condition is triggered halfway down. We therefore have four complete loops to count - Total t-cycles = 546 t-cycles at start + 72 t-cycles at end + 62 t-cycles in each complete loop x number of loops 84 x 4 t-cycles in last loop (which may be only a partial loop) 76

We are now asked to apply this value to a given speed of processor. For this, we need to work out the length of the t-cycle as shown at the start of the lecture – 1.2 GHz t-cycle = 1 1.2X 10 –9 seconds So 546 of them will take X 10 –9 seconds or 455 x 10 –9 seconds.

Now use what you have learned to work out the time taken to process the second set of inputs – A, b, h. 9, x, S Watch this one, because the last loop, where the stopping condition is met, will be different from what happened with the first set of data!

Summary [1] The time taken to execute an assembly code program is measured in t-cycles. Each t-cycle represents the space between clock “ticks”. The actual length of the t-cycle depends on the speed of the processor. To analyse the source code - establish how many t-cycles each instruction takes. establish what happens at the beginning, in the middle and at the end of the program. work out how many whole loops will be completed, and whether the last loop is a partial one.

Summary [2] Apply the total number of t-cycles to the processor speed, to work out in real time, how long the source code will take to run. Always display your results in scientific notation, e.g. 455 x 10 –9 seconds. You will be required to depict this on a graph later! For your assessment, you will be required to analyse two separate programs using different instruction sets. Although the languages are different, the principles remain the same!