RAM (cont.) 220 bytes of RAM (1 Mega-byte) 20 bits of address Address

Slides:



Advertisements
Similar presentations
Computer Memory and Data Transfer
Advertisements

SE 292 (3:0) High Performance Computing L2: Basic Computer Organization R. Govindarajan
Stored Program Architecture
Instruction Set Design
Chapter 2 Data Manipulation Dr. Farzana Rahman Assistant Professor Department of Computer Science James Madison University 1 Some sldes are adapted from.
ISA Issues; Performance Considerations. Testing / System Verilog: ECE385.
The Central Processing Unit: What Goes on Inside the Computer.
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
Microprocessor and Microcontroller Based Systems Instructor: Eng.Moayed N. EL Mobaied The Islamic University of Gaza Faculty of Engineering Electrical.
Processor Technology and Architecture
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Introduction to Computer Systems
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic Combinational logic elements and design (DeMorgan’s Law)
Computer Hardware Processing and Internal Memory.
Stored Program Concept: The Hardware View
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Machine Languages Different types of CPU’s understand different instructions Pentium family / Celeron / Xeon / AMD K6 / Cyrix … (Intel x86 family) PowerPC.
Computer Systems CS208. Major Components of a Computer System Processor (CPU) Runs program instructions Main Memory Storage for running programs and current.
Processor Types And Instruction Sets Barak Perelman CS147 Prof. Lee.
Basic Microcomputer Design. Inside the CPU Registers – storage locations Control Unit (CU) – coordinates the sequencing of steps involved in executing.
E0001 Computers in Engineering1 The System Unit & Memory.
The Computer Systems By : Prabir Nandi Computer Instructor KV Lumding.
What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions.
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
Hardware & Software The CPU & Memory.
1 4.2 MARIE This is the MARIE architecture shown graphically.
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Computers organization & Assembly Language Chapter 0 INTRODUCTION TO COMPUTING Basic Concepts.
Finite State Machines (FSMs) and RAMs and inner workings of CPUs COS 116, Spring 2010 Guest: Szymon Rusinkiewicz.
Introduction to Computing Systems from bits & gates to C & beyond The Von Neumann Model Basic components Instruction processing.
Microcode Source: Digital Computer Electronics (Malvino and Brown)
Chapter 4 MARIE: An Introduction to a Simple Computer.
Introduction to Computer Architecture. What is binary? We use the decimal (base 10) number system Binary is the base 2 number system Ten different numbers.
Computer Architecture And Organization UNIT-II Structured Organization.
Lesson 3 — How a Computer Processes Data Unit 1 — Computer Basics.
Cis303a_chapt04.ppt Chapter 4 Processor Technology and Architecture Internal Components CPU Operation (internal components) Control Unit Move data and.
Introduction to Computer Architecture. What is binary? We use the decimal (base 10) number system Binary is the base 2 number system Ten different numbers.
Finite State Machines (FSMs) and RAMs and CPUs COS 116, Spring 2011 Sanjeev Arora.
Lecture 14 Today’s topics MARIE Architecture Registers Buses
Computer Organization & Assembly Language © by DR. M. Amer.
PHY 201 (Blum)1 Microcode Source: Digital Computer Electronics (Malvino and Brown)
Introduction to Microprocessors
Lecture 7: 9/17/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Computer Structure & Architecture 7b - CPU & Buses.
Electronic Analog Computer Dr. Amin Danial Asham by.
MICROOCESSORS AND MICROCONTROLLER:
CS 1308 Computer Literacy and the Internet. Objectives In this chapter, you will learn about:  The components of a computer system  Putting all the.
Excellence Publication Co. Ltd. Volume Volume 1.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Lecture on Central Process Unit (CPU)
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Computers. Light A Review: State Machine IF A=1 AND B=0 Always IF A=0 AND B=1 Otherwise Light B Otherwise Always.
Simple ALU How to perform this C language integer operation in the computer C=A+B; ? The arithmetic/logic unit (ALU) of a processor performs integer arithmetic.
CMSC 104, Lecture 061 Stored Programs A look at how programs are executed.
Computer Organization Instructions Language of The Computer (MIPS) 2.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
The Processor & its components. The CPU The brain. Performs all major calculations. Controls and manages the operations of other components of the computer.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
BASIC COMPUTER ARCHITECTURE HOW COMPUTER SYSTEMS WORK.
CPIT Program Execution. Today, general-purpose computers use a set of instructions called a program to process data. A computer executes the.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Introduction to Computer Architecture
Computer Architecture
The Von Neumann Model Basic components Instruction processing
Introduction to Computer Architecture
Chapter 5: Computer Systems Organization
Presentation transcript:

RAM (cont.) 220 bytes of RAM (1 Mega-byte) 20 bits of address Address Data input Data Output Write 8 bits (1 byte) of data

RAM (cont.) When you talk about the memory of a computer, most often you’re talking about its RAM. If a program is stored in RAM, that means that a sequence of instructions are stored in consecutively addressed bytes in the RAM. Data values (variables) are stored anywhere in RAM, not necessarily sequentially Both instructions and data are accessed from RAM using addresses RAM is one (crucial) part of the computer’s overall architecture

Computer Architecture Central Processing Unit CPU Input/ Output Devices Bus RAM

Computer Architecture CPU Keyboard Display Bus Hard Disk CD-ROM RAM

The Bus What is a bus? It is a simplified way for many devices to communicate to each other. Looks like a “highway” for information. Actually, more like a “basket” that they all share. CPU Keyboard Display Bus

The Bus CPU Keyboard Display Bus

The Bus Suppose CPU needs to check to see if the user typed anything. Keyboard Display Bus

The Bus CPU puts “Keyboard, did the user type anything?” (represented in some way) on the Bus. CPU Keyboard Display Bus “Keyboard, did the user type anything?”

The Bus Each device (except CPU) is a State Machine that constantly checks to see what’s on the Bus. CPU Keyboard Display Bus “Keyboard, did the user type anything?”

The Bus Keyboard notices that its name is on the Bus, and reads info. Other devices ignore the info. CPU Keyboard Display Bus “Keyboard, did the user type anything?”

The Bus Keyboard then writes “CPU: Yes, user typed ‘a’.” to the Bus. Display Bus “CPU: Yes, user typed ‘a’.”

The Bus At some point, CPU reads the Bus, and gets the Keyboard’s response. CPU Keyboard Display Bus “CPU: Yes, user typed ‘a’.”

Computer Architecture CPU Keyboard Display Bus Hard Disk CD-ROM RAM

Inside the CPU The CPU is the brain of the computer. It is the part that actually executes the instructions. Let’s take a look inside.

Inside the CPU (cont.) Memory Registers Register 0 Register 1 Temporary Memory. Computer “Loads” data from RAM to registers, performs operations on data in registers, and “stores” results from registers back to RAM Register 0 Register 1 Register 2 Register 3 Remember our initial example: “read value of A from memory; read value of B from memory; add values of A and B; put result in memory in variable C.” The reads are done to registers, the addition is done in registers, and the result is written to memory from a register.

Inside the CPU (cont.) Memory Registers Register 0 Arithmetic / Logic Unit Register 1 Register 2 Register 3 For doing basic Arithmetic / Logic Operations on Values stored in the Registers

Inside the CPU (cont.) Memory Registers Register 0 Arithmetic / Logic Unit Register 1 Register 2 Register 3 To hold the current instruction Instruction Register

Inside the CPU (cont.) Memory Registers Register 0 Arithmetic / Logic Unit Register 1 Register 2 Register 3 To hold the address of the current instruction in RAM Instruction Register Instr. Pointer (IP)

Inside the CPU (cont.) Memory Registers Register 0 Arithmetic / Logic Unit Register 1 Register 2 Register 3 Control Unit (State Machine) Instruction Register Instr. Pointer (IP)

The Control Unit It all comes down to the Control Unit. This is just a State Machine. How does it work?

The Control Unit Control Unit State Machine has very simple structure: 1) Fetch: Ask the RAM for the instruction whose address is stored in IP. 2) Execute: There are only a small number of possible instructions. Depending on which it is, do what is necessary to execute it. 3) Repeat: Add 1 to the address stored in IP, and go back to Step 1 !

The Control Unit is a State Machine Fetch Add Load Store Goto … Exec … Add 1 to IP

A Simple Program Want to add values of variables a and b (assumed to be in memory), and put the result in variable c in memory, I.e. c  a+b Instructions in program Load a into register r1 Load b into register r3 r2  r1 + r3 Store r2 in c

Running the Program a c b r1 r2 r3 Memory r4 IR IP CPU Logic 2005 2006 Load a into r1 Load b into r3 r2 r1 + r3 Store r2 into c 2005 2006 2007 2008 b r1 r2 r3 r4 IR IP Logic CPU 2 Load a into r1 2005

Running the Program a c b r1 r2 r3 Memory r4 IR IP CPU Logic 2005 2006 Load a into r1 Load b into r3 r2 r1 + r3 Store r2 into c 2005 2006 2007 2008 b r1 r2 r3 r4 IR IP Logic CPU 2 3 Load b into r3 2006

Running the Program a c b r1 r2 r3 Memory r4 IR IP CPU Logic 2005 2006 Load a into r1 Load b into r3 r2 r1 + r3 Store r2 into c 2005 2006 2007 2008 b r1 r2 r3 r4 IR IP Logic CPU 2 5 3 r2  r1 + r3 2007

Running the Program a c b r1 r2 r3 Memory r4 IR IP CPU Logic 2005 2006 Load a into r1 Load b into r3 r2 r1 + r3 Store r2 into c 2005 2006 2007 2008 b r1 r2 r3 r4 IR IP Logic CPU 2 5 3 Store r2 into c 2008

Running the Program a c b r1 r2 r3 Memory r4 IR IP CPU Logic 2005 2006 Load a into r1 Load b into r3 r2 r1 + r3 Store r2 into c 2005 2006 2007 2008 b r1 r2 r3 r4 IR IP Logic CPU 2 5 3 Store r2 into c 2008

Putting it all together Computer has many parts, connected by a Bus: CPU Keyboard Display Bus Hard Disk CD-ROM RAM

Putting it all together The RAM is the computer’s main memory. This is where programs and data are stored. CPU Keyboard Display Bus Hard Disk CD-ROM RAM

Putting it all together The CPU goes in a never-ending cycle, reading instructions from RAM and executing them. CPU Keyboard Display Bus Hard Disk CD-ROM RAM

Putting it all together This cycle is orchestrated by the Control Unit in the CPU. Memory Registers Register 0 Arithmetic / Logic Unit Register 1 Register 2 Register 3 Control Unit (State Machine) Instruction Register Instr. Pointer (IP)

Back to the Control Unit It simply looks at where IP is pointing, reads the instruction there from RAM, and executes it. Memory Registers Register 0 Arithmetic / Logic Unit Register 1 Register 2 Register 3 Control Unit (State Machine) Instruction Register Instr. Pointer (IP)

Putting it all together To execute an instruction, the Control Unit uses the ALU plus Memory and/or the Registers. Memory Registers Register 0 Arithmetic / Logic Unit Register 1 Register 2 Register 3 Control Unit (State Machine) Instruction Register Instr. Pointer (IP)

Programming

Where we are Examined the hardware for a computer Truth tables Logic gates States and transitions in a state machine The workings of a CPU and Memory Now, want to program the hardware

Programs and Instructions Programs are made up of instructions CPU executes one instruction every clock cycle Modern CPUS do more, but we ignore that Specifying a program and its instructions: Lowest level: Machine language Intermediate level: Assembly language Typically today: High-level programming language

Specifying a Program and its Instructions High-level programs: each statement translates to many instructions E.g. c  a + b to: Assembly language: specify each machine instruction, using mnemonic form E.g. Load r1, A Machine language: specify each machine instruction, using bit patterns E.g. 1101101000001110011 Load a into r1 Load b into r3 r2  r1 + r3 Store r2 into c

Machine/Assembly Language We have a machine that can execute instructions Basic Questions: What instructions? How are these instructions represented to the computer hardware?

Complex vs Simple Instructions Computers used to have very complicated instruction sets – this was known as: CISC = Complex Instruction Set Computer Almost all computers 20 years ago were CISC. 80s introduced RISC: RISC = Reduced Instruction Set Computer

Complex vs Simple Instructions RISC = Reduced Instruction Set Computer Fewer, Less powerful basic instructions But Simpler, Faster, Easier to design CPU’s Can make “powerful” instructions by combining several wimpy ones Shown to deliver better performance than Complex Instruction Set Computer (CISC) for several types of applications.

Complex vs Simple Instructions Nevertheless, Pentium is actually CISC ! Why?

Complex vs Simple Instructions Nevertheless, Pentium is actually CISC ! Why: Compatibility with older software Newer application types (media processing etc) perform better with specialized instructions The world has become too complex to talk about RISC versus CISC

Typical Assembly Instructions Some common assembly instructions include: 1) “Load” – Load a value from RAM into one of the registers 2) “Load Direct” – Put a fixed value in one of the registers (as specified) 3) “Store” - Store the value in a specified register to the RAM 4) “Add” - Add the contents of two registers and put the result in a third register

Typical Assembly Instructions Some common instructions include: 5) “Compare” - If the value in a specified register is larger than the value in a second register, put a “0” in Register r0 6) “Jump” - If the value in Register r0 is “0”, change Instruction Pointer to the value in a given register 7) “Branch” - If the value in a specified register is larger than that in another register, change IP to a specified value

Machine Languages Different types of CPU’s understand different instructions Pentium family / Celeron / Xeon / AMD K6 / Cyrix … (Intel x86 family) PowerPC (Mac) DragonBall (Palm Pilot) StrongARM/MIPS (WinCE) Many Others (specialized or general-purpose) They represent instructions differently in their assembly/machine languages (even common ones) Let’s look instructions for a simple example CPU