COMP 1321 Digital Infrastructure

Slides:



Advertisements
Similar presentations
Register In computer architecture, a processor register is a small amount of storage available on the CPU whose contents can be accessed more quickly than.
Advertisements

MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#3) By Dr. Syed Noman.
CBP Comp 1017 Digital Technologies1 Let’s make a Computer … at least the CPU … Pentium 4 Pentium 3 Opteron Ultra Sparc Itanium 2 McKinley.
CBP Comp 1017 Digital Technologies1 Let’s make a Computer.
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
Basic Operational Concepts of a Computer
An Introduction to 8086 Microprocessor.
Internal hardware and external components of a computer Three-box Model  Processor The brain of the system Executes programs A big finite state machine.
Lecture 8 Presented By Dr. Shazzad Hosain Asst. Prof. EECS, NSU.
COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2013.
Assembly Language A Brief Introduction. Unit Learning Goals CPU architecture. Basic Assembler Commands High level Programming  Assembler  Machine Language.
COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.
COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2015.
COMPILERS CLASS 22/7,23/7. Introduction Compiler: A Compiler is a program that can read a program in one language (Source) and translate it into an equivalent.
8086 Internal Architecture
Computer Organization 1 Instruction Fetch and Execute.
20 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
CBP Comp 1017 Digital Technologies1 Let’s make a Computer … at least the CPU … Pentium 4 Pentium 3 Opteron Ultra Sparc Itanium 2 McKinley.
Our programmer needs to do this !
COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2015.
COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2012.
CBP 2002ITY 270 Computer Architecture1 Module Structure Whirlwind Review – Fetch-Execute Simulation Instruction Set Architectures RISC vs x86 How to build.
Microprocessor Fundamentals Week 2 Mount Druitt College of TAFE Dept. Electrical Engineering 2008.
Capability of processor determine the capability of the computer system. Therefore, processor is the key element or heart of a computer system. Other.
1 3 Computing System Fundamentals 3.2 Computer Architecture.
Chapter 20 Computer Operations Computer Studies Today Chapter 20.
Computer Operation. Binary Codes CPU operates in binary codes Representation of values in binary codes Instructions to CPU in binary codes Addresses in.
1 x86 Programming Model Microprocessor Computer Architectures Lab Components of any Computer System Control – logic that controls fetching/execution of.
I NTEL 8086 M icroprocessor بسم الله الرحمن الرحيم 1.
ΜComputer Structure μProcessor Memory Bus System I/O Ports.
Types of Micro-operation  Transfer data between registers  Transfer data from register to external  Transfer data from external to register  Perform.
Computer Hardware What is a CPU.
CPU Lesson 2.
Homework Reading Lab with your assigned section starts next week
COMP 1321 Digital Infrastructure
Computing Systems Organization
CPU Organisation & Operation
Edexcel GCSE Computer Science Topic 15 - The Processor (CPU)
Chapter 4 The Von Neumann Model
8086 Microprocessor.
Computer Organization & Assembly Language Chapter 3
COURSE OUTCOMES OF MICROPROCESSOR AND PROGRAMMING
Lecture on Microcomputer
Assembly Language for Intel-Based Computers, 5th Edition
THE CPU i Bytes 1.1.
Introduction of microprocessor
Components of Computer
Components of Computer
University of Gujrat Department of Computer Science
Homework Reading Continue work on mp1
Instructions at the Lowest Level
Symbolic Instruction and Addressing
Introduction to Assembly Language
BIC 10503: COMPUTER ARCHITECTURE
Number Representations and Basic Processor Architecture
University of Gujrat Department of Computer Science
8086 Registers Module M14.2 Sections 9.2, 10.1.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
Intel 8080 Processor The 8080 was an 8-bit processor
COMP 1321 Digital Infrastructure
Symbolic Instruction and Addressing
Central Processing Unit
CNET 315 Microprocessor & Assembly Language
Lecture 06 Programming language.
Computer Architecture CST 250
Unit-I 80386DX Architecture
COMP 1321 Digital Infrastructure
Chapter 6 –Symbolic Instruction and Addressing
Presentation transcript:

COMP 1321 Digital Infrastructure Richard Henson University of Worcester October 2018

Week 3: Programming a CPU Explain how logic gates can create a CPU Understand how registers and memory addresses are used to process input and store the results

How can logic gates make a CPU? Overview: https://www.youtube.com/watch?v=1I5ZMmrOfnA Early “chips” called integrated circuits e.g. Intel 7481 ALU (Arithmetic & Logic Unit) do arithmetic e.g. “adding” provide logic…

Minimalist CPU What is needed to build a successful CPU? ALU (Arithmetic Logic Unit) Memory (to store intermediate data)) “Execution Unit” Input & Output A Good Name! Intel’s first (1972) was called… “4004”… because it had a 4-bit bus!

Arithmetic Logic Unit (ALU) (or… more sophisticated… Integer Execution Unit) Input A Input B Output 5 3 2 add 1 3 2 sub How could these numbers be represented as data that passes into the ALU?

Programming Commands and Machine Code A set of instructions for the CPU can be put into a program that can be executed one after the other these instructions are known as machine code Each type of CPU has its own type of “machine language”.

Storing Results of Calculations Memory is needed (let’s start with 8-bit data): to feed ALU input to record ALU output Overview: https://www.youtube.com/watch?v=fpnE6UAfbtU

Move data in and out of data memory store Processing Idea Nr. 1 Move data in and out of data memory store 1. Move data from memory 5 3 2 add 1 4 Memory DRAM, Hard Disk .. 2. 3. Move data into memory

Sequence of CPU commands If the CPU is going to do something useful, it needs a sequence of commands e.g. move number into ALU from memory move another number in from memory add them together move the result into memory…

Move instructions into CPU from code memory Processing Idea Nr.2 Move instructions into CPU from code memory Instruction Memory 5 3 2 add 1 4 (Code Memory) mov 3 in from memory mov 2 in from memory add the two numbers mov the result to memory IP Program

Registers Registers are high-speed memory stores on the CPU chip Parking places for data on the move 1 4 6 8 AX BX AX and BX are used for ALU operations MAR MAR is memory address register, here 4. So result, 6+8=14 will go into memory cell address 4

The computer so far … ip Data Memory Instruction Memory 1 4 mar

A couple of extra bits.. Line of code goes in… Memory Data Register Instruction Register Data Memory 1 4 1. 2 add ax,bx 2. 8 34 Instruction Memory Data Energize ax Energize bx Select ALU “add" 2 Address 34 Line of code goes in… Electrical bit signals come out

Moving data into Registers For example … mov ax , [1] Instruction Memory 1 2 mar 3 4 AX mov ax , [1] BX mov bx , [2] 5 mov bx , [2] 8 7 8 7 6 1

Moving data into Memory For example … mov [3] , ax Instruction Memory 1 2 mar 3 4 mov [0], bx AX mov [3] , ax BX 5 7 mov [0] , bx 8 7 8 7 6 8 1

… this means ‘ add ax to bx, put the answer in ax’ Adding Numbers For example … add ax , bx Instruction Memory 1 2 mar 3 4 … this means ‘ add ax to bx, put the answer in ax’ AX Add ax,bx BX 5 8 7 8 7 8 7 15 6 1

Now let’s slow things down… Today’s CPUs process billions of instructions every second in the early days (Intel 4004) it was merely millions! Many great simulators have been produced that can work through a machine code program one cycle, or one instruction, at a time…

What is “Processing”? Mostly… calculations by the ALU: need data input from register from external memory need to store output Could also be just a command, no data needed…

CPU types Most frequently used: We’ll focus on Intel 8086 family Motorola (esp. 68000 family) ARM (many mobile phones) We’ll focus on Intel 8086 family dates back to original IBM PC…

Role of “Registers” Memory stores inside the CPU just the right size “word” of data for ALU typically 1, 2, 4 bytes i.e. very small! Advantage: CPU reads/writes the data very very quickly to/from the registers

Architecture and Buses Design of CPU internal connections external connections to motherboard data bus (same word as registers) address bus (depends on no of memory locations) control bus (messages to/from components) layout of components on motherboard

Registers (summary…) high-speed memory on the CPU chip Parking places for data on the move 1 4 6 8 AX BX AX and BX registers are used for ALU operations MARR MAR is memory address register, 4 in eg. Result of processing, 6+8=14, will go into memory address 4

(identify & name components) The computer so far… (identify & name components) ip Data Memory Instruction Memory 1 4 mar

A couple of extra registers.. Memory Data Register Instruction Register Data Memory 1 4 1. 2 add ax,bx 2. 8 34 Instruction Memory Data Energize ax Energize bx Select ALU “add" 2 Address 34 Line of code goes in… Electrical bit signals come out

Moving data into Registers (ie from specified location) mov ax , [1] for example … Instruction Memory 1 2 mar 3 4 AX mov ax , [1] BX mov bx , [2] 5 mov bx , [2] 8 7 8 7 6 1

Moving data into Memory For example … mov [3] , ax Instruction Memory 1 2 mar 3 4 mov [0], bx AX mov [3] , ax BX 5 7 mov [0] , bx 8 7 8 7 6 8 1

8086 CPU family registers 8086 chip always used a 16-bit word SAM simulates an 8-bit word popular on most early microcomputers… Typical 8086 registers (stores): general purpose data: AX, BX, CX, DX specific use e.g. program counter (PC): instruction address in memory stack pointer SP): address of the top of the “stack”

Data and Addressing General purpose register contents… Convention: memory address that points to data Convention: data written as hexadecimal equivalent e.g. 4A memory location also has square brackets e.g. [4A]

CPU Instructions Used to tell the CPU what to do… MOV is for moving data around… MOV AX, 4A – move “4A” into AX register MOV AX, [4A] – move data contained in address 4A into AX register Many other instructions; range of operations… collectively known as an instruction set each CPU family has its own unique codes

8086 in practice Four 16-bit General Purpose registers each gen register (e.g. AX) can be read/written to upper (AH) & lower (AL) byte upper byte lower byte AX AH AL BX BH BL CX CH CL DX DH DL

Another 8086 Instruction: ADD Takes values from two registers Adds them together Deposits results back in one of the registers Which one? the register that appeared first e.g. “MOV, AX, BX” puts result in AX

8088: Brains of the IBM PC

Inside the 8088 address bus address adder External buses gen registers ALU

1 Pentium (8086 family) 2 Fetch Decode ALU Mem Ops Reg Write 3 4 5

Intel Multi-core

Programming a CPU CPU programming code written as assembly language each family has its own instruction set Programming syntax depends on the CPU/instructions how they should be used Intel 8086 assembly language used for CPUs that support PC platforms

Example 8086 Assembly Language MOV AH,08 INT 21 MOV DL,AL MOV AH,02 MOV AH,4C

So THAT’S how it all works So THAT’S how it all works!  Now try it on a simulator… Next week: a focus on the fetch-execute cycle