CC312: Computer Organization

Similar documents
Chapter 4. MARIE: An Introduction to a Simple Computer

MARIE: An Introduction to a Simple Computer

Chapter 4. MARIE: An Introduction to a Simple Computer. Chapter 4 Objectives. 4.1 Introduction. 4.2 CPU Basics

Chapter 4. Chapter 4 Objectives. MARIE: An Introduction to a Simple Computer

MARIE: An Introduction to a Simple Computer

Chapter 4. Chapter 4 Objectives

Department of Computer and Mathematical Sciences. Lab 4: Introduction to MARIE

Computer Organization II CMSC 3833 Lecture 33

CHAPTER 4 MARIE: An Introduction to a Simple Computer

The MARIE Architecture

Computer Systems and Networks. ECPE 170 Jeff Shafer University of the Pacific. Introduc>on to MARIE

Notes: The Marie Simulator

Computer Architecture. CSE 1019Y Week 16. Introduc>on to MARIE

Chapter 4. MARIE: An Introduction to a Simple Computer 4.8 MARIE 4.8 MARIE A Discussion on Decoding

Problem Points Your Points Total 80

MARIE: An Introduction to a Simple Computer

CS311 Lecture: The Architecture of a Simple Computer

2.2 THE MARIE Instruction Set Architecture

CSE100 Lecture03 Machines, Instructions, and Programs Introduction to Computer Systems

THE MICROPROCESSOR Von Neumann s Architecture Model

Lecture1: introduction. Outline: History overview Central processing unite Register set Special purpose address registers Datapath Control unit

William Stallings Computer Organization and Architecture

a number of pencil-and-paper(-and-calculator) questions two Intel assembly programming questions

Chapter 16. Control Unit Operation. Yonsei University

Processing Unit CS206T

EE 3170 Microcontroller Applications

Computer Organization CS 206 T Lec# 2: Instruction Sets

Digital System Design Using Verilog. - Processing Unit Design

Micro-programmed Control Ch 15

Machine Instructions vs. Micro-instructions. Micro-programmed Control Ch 15. Machine Instructions vs. Micro-instructions (2) Hardwired Control (4)

Micro-programmed Control Ch 15

CMSC 3833 Lecture 37

Chapter 3 : Control Unit

SCRAM Introduction. Philipp Koehn. 19 February 2018

Computer Architecture

Computer Architecture 2/26/01 Lecture #

Micro-programmed Control Ch 17

Hardwired Control (4) Micro-programmed Control Ch 17. Micro-programmed Control (3) Machine Instructions vs. Micro-instructions

Outcomes. Lecture 13 - Introduction to the Central Processing Unit (CPU) Central Processing UNIT (CPU) or Processor

FACTFILE: GCE DIGITAL TECHNOLOGY

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Micro-Operations. execution of a sequence of steps, i.e., cycles

Chapter 5. Computer Architecture Organization and Design. Computer System Architecture Database Lab, SANGJI University

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

There are four registers involved in the fetch cycle: MAR, MBR, PC, and IR.

Module 5 - CPU Design

Introduction to Computers - Chapter 4

PART A (22 Marks) 2. a) Briefly write about r's complement and (r-1)'s complement. [8] b) Explain any two ways of adding decimal numbers.

Faculty of Engineering Systems & Biomedical Dept. First Year Cairo University Sheet 6 Computer I

The Itanium Bit Microprocessor Report

1. Fundamental Concepts

CS 101, Mock Computer Architecture

2 MARKS Q&A 1 KNREDDY UNIT-I

Computer architecture Assignment 3

Latches. IT 3123 Hardware and Software Concepts. Registers. The Little Man has Registers. Data Registers. Program Counter


The Institution of Engineers - Sri Lanka

MICROPROGRAMMED CONTROL

Register Are Two Names For The Same Place

Materials: 1. Projectable Version of Diagrams 2. MIPS Simulation 3. Code for Lab 5 - part 1 to demonstrate using microprogramming

CPE300: Digital System Architecture and Design

CPU Structure and Function

Computer Organization

General purpose registers These are memory units within the CPU designed to hold temporary data.

UNIT-II. Part-2: CENTRAL PROCESSING UNIT

COMPUTER ORGANIZATION AND ARCHITECTURE

Chapter 7: Processor and Memory

CPU ARCHITECTURE. QUESTION 1 Explain how the width of the data bus and system clock speed affect the performance of a computer system.

Class Notes. Dr.C.N.Zhang. Department of Computer Science. University of Regina. Regina, SK, Canada, S4S 0A2

1. Internal Architecture of 8085 Microprocessor

DC57 COMPUTER ORGANIZATION JUNE 2013

Understand the factors involved in instruction set

Computer Architecture

Segment 1A. Introduction to Microcomputer and Microprocessor

3 Computer Architecture and Assembly Language

CDA 3103 Computer Organization Homework #7 Solution Set

A3 Computer Architecture

COMARCH. COMPUTER ARCHITECTURE TERM 3 SY COMPUTER ENGINEERING DE LA SALLE UNIVERSITY Quiz 1

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

CPU Structure and Function. Chapter 12, William Stallings Computer Organization and Architecture 7 th Edition

Materials: 1. Projectable Version of Diagrams 2. MIPS Simulation 3. Code for Lab 5 - part 1 to demonstrate using microprogramming

MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEMS

CHAPTER 5 Basic Organization and Design Outline Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle

Computer Organization and Architecture, Pt. 2

Lecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers.

CHAPTER 5 A Closer Look at Instruction Set Architectures


5 Computer Organization

Overview of Computer Organization. Outline

Chapter 2 Instruction Set Architecture

Arab Open University. Computer Organization and Architecture - T103

Chapter 5. A Closer Look at Instruction Set Architectures

Blog -

omputer Design Concept adao Nakamura

Introduction to Microcontrollers

Microprocessors/Microcontrollers

Course Description: This course includes concepts of instruction set architecture,

SAE5C Computer Organization and Architecture. Unit : I - V

Major and Minor States

Microcontroller Systems

Transcription:

CC312: Computer Organization Dr. Ahmed Abou EL-Farag Dr. Marwa El-Shenawy 1

Chapter 4 MARIE: An Introduction to a Simple Computer

Chapter 4 Objectives Learn the components common to every modern computer system. Be able to explain how each component contributes to program execution. Understand a simple architecture using these basic concepts. Understand how computer components work, and how they fit together to create a computer systems. Know how the program assembly process works. 3

4.1 Introduction The computer s CPU Fetches, Decodes, and Executes program instructions. The two principal parts of the CPU are The datapath (ALU, Registers, Data bus) The control unit. CPU components perform sequenced operations according to signals provided by its control unit. 4

4.2 CPU Basics Registers hold data accessed by the CPU. The arithmetic-logic unit (ALU) carries out logical and arithmetic operations as directed by the control unit. The control unit determines which actions to carry out. The CPU shares data with other system components by way of a data bus. A bus is a set of wires that simultaneously convey a single bit along each line. 5

4.3 The Bus Two types of buses are commonly found in computer systems: point-to-point, and multipoint buses. 6

4.3 The Bus Buses consist of Data lines, Control lines, and Address lines. Data lines: convey bits from one device to another, Control lines: determine the direction of data flow, and when each device can access the bus. Address lines: determine the location of the source or destination of the data. 7

4.3 The Bus 8

4.3 The Bus A multipoint bus is a shared resource, Access to it is controlled through protocols, which are built into the hardware. 9

4.5 The Input / Output Subsystem In a master-slave configuration, more than one device can be the bus master, concurrent bus master requests must be arbitrated. Four categories of bus arbitration are: Daisy chain: Permissions are passed from the highestpriority device to the lowest. Centralized parallel: Each device is directly connected to an arbitration circuit. Distributed using self-detection: Devices decide which gets the bus among themselves. Distributed using collisiondetection: Any device can try to use the bus. If its data collides with the data of another device, it tries again. 10

4.4 Clocks Every computer contains at least one clock that synchronizes the activities of its components. A fixed number of clock cycles are required to carry out each data movement or computational operation. The clock frequency, measured in megahertz or gigahertz, determines the speed with which all operations are carried out. Clock cycle time is the reciprocal of clock frequency. An 800 MHz clock has a cycle time of 1.25 ns. 11

4.4 Clocks The clock synchronizes the activities of computer components. A fixed number of clock cycles are required to carry out each data movement or computational operation. The CPU time required to run a program is given by the general performance equation: We will return to this important equation in later chapters. 12

4.6 Memory Organization The memory consists of a linear array of addressable storage cells that are similar to registers. Memory is constructed of RAM chips, often referred to in terms of length width. The 4K can be expressed as 2 2 2 10 = 2 12 words. The memory locations for this memory are numbered 0 through 2 12-1. The memory bus of this system requires 12 address lines. 13

4.8 MARIE MARIE : Machine Architecture that is Really Intuitive and Easy While this system is too simple to do anything useful in the real world, a deep understanding of its functions will enable you to comprehend system architectures that are much more complex. 14

4.8 MARIE The MARIE architecture has the following characteristics: Binary, two's complement data representation. Stored program, fixed word length data and instructions. 4K words of word-addressable main memory. 16-bit data words. 16-bit instructions, 4 for the opcode and 12 for the address. A 16-bit arithmetic logic unit (ALU). Seven registers for control and data movement. 15

4.8 MARIE MARIE s seven registers are: Accumulator, AC, a 16-bit register that holds a conditional operator (e.g., "less than") or one operand of a two-operand instruction. Memory address register, MAR, a 12-bit register that holds the memory address of an instruction or the operand of an instruction. Memory buffer register, MBR, a 16-bit register that holds the data after its retrieval from, or before its placement in memory. 16

4.8 MARIE MARIE s seven registers are: Program counter, PC, a 12-bit register that holds the address of the next program instruction to be executed. Instruction register, IR, which holds an instruction immediately preceding its execution. Input register, InREG, an 8-bit register that holds data read from an input device. Output register, OutREG, an 8-bit register, that holds data that is ready for the output device. 17

4.8 MARIE This is the MARIE architecture: 18

4.8 MARIE This is the MARIE data path 19

4.8 MARIE A computer s instruction set architecture (ISA) specifies the format of its instructions and the primitive operations that the machine can perform. The ISA is an interface between a computer s hardware and its software. Some ISAs include hundreds of different instructions for processing data and controlling program execution. The MARIE ISA consists of only thirteen instructions. 20

4.8 MARIE The format of a MARIE instruction: The fundamental MARIE instructions are: 21

4.8 MARIE This is a bit pattern for a LOAD instruction as it would appear in the IR: The opcode is 1 The address from which to load the data is 3. LOAD 3 22

4.8 MARIE This is a bit pattern for a SKIPCOND instruction as it would appear in the IR: We see that the opcode is 8 and bits 11 and 10 are 10, meaning that the next instruction will be skipped if the value in the AC is greater than zero. What is the hexadecimal representation of this instruction? 23

4.8 MARIE Each of our instructions actually consists of a sequence of smaller instructions called microoperations. The exact sequence of microoperations that are carried out by an instruction can be specified using register transfer language (RTL). In the MARIE RTL: M[X] to indicate the actual data value stored in memory location X, to indicate the transfer of bytes to a register or memory location. 24

4.8 MARIE The RTL for the LOAD x instruction is: MAR X MBR M[MAR], AC MBR 25

4.8 MARIE The RTL for the ADD x instruction is: MAR X MBR M[MAR] AC AC + MBR 26

4.8 MARIE SKIPCOND skips the next instruction according to the value of the AC. The RTL for the this instruction is: If IR[11-10] = 00 then If AC < 0 then PC PC + 1 else If IR[11-10] = 01 then If AC = 0 then PC PC + 1 else If IR[11-10] = 11 then If AC > 0 then PC PC + 1 27

4.9 Instruction Processing The fetch-decode-execute cycle is the series of steps that a computer carries out when it runs a program. We first have to fetch an instruction from memory, and place it into the IR. Once in the IR, it is decoded to determine what needs to be done next. If a memory value (operand) is involved in the operation, it is retrieved and placed into the MBR. With everything in place, the instruction is executed. The next slide shows a flowchart of this process. 28

4.9 Instruction Processing 29

4.10 A Simple Program Consider the simple MARIE program given below. The set of mnemonic instructions stored at addresses 100-106 (hex): 30

4.10 A Simple Program What happens inside the computer when this program runs. This is the LOAD 104 instruction: 31

4.10 A Simple Program The second instruction is ADD 105: 32

4.9 Instruction Processing 33

Extending Instruction Set 34

4.12 Extending Our Instruction Set So far, all of the MARIE instructions that we have discussed use a direct addressing mode. This means that the address of the operand is explicitly stated in the instruction. In the indirect addressing, the address of the address of the operand is given in the instruction. If you have ever used pointers in a program, you are already familiar with indirect addressing. 35

4.12 Extending The Instruction Set ADDI instruction specifies the address of the address of the operand. ADDI X MAR X MBR M[MAR] MAR MBR MBR M[MAR] AC AC + MBR 36

4.12 Extending Our Instruction Set We have included three indirect addressing mode instructions in the MARIE instruction set. The first two are LOADI X and STOREI X where specifies the address of the operand to be loaded or stored. In RTL : MAR X MBR M[MAR] MAR MBR MBR M[MAR] AC MBR MAR X MBR M[MAR] MAR MBR MBR AC M[MAR] MBR LOADI X STOREI X 37

4.12 Extending The Instruction Set JNS, jump-and-store subroutine Call JNS X MBR PC MAR X M[MAR] MBR MBR X AC 1 AC AC + MBR PC AC Does JNS permit recursive calls? 38

4.12 Extending The Instruction Set JumpI, jump indirect subroutine return JumpI X MAR X MBR M[MAR] PC MBR 39

4.12 Extending Our Instruction Set Our last instruction is the CLEAR instruction. All it does is set the contents of the accumulator to all zeroes. This is the RTL for CLEAR: AC 0 We put our new instructions to work in the program on the following slide. 40

4.12 Extending Our Instruction Set 100 LOAD Addr 101 STORE Next 102 LOAD Num 103 SUBT One 104 STORE Ctr 105 CLEAR 106 Loop LOAD Sum 107 ADDI Next 108 STORE Sum 109 LOAD Next 10A ADD One 10B STORE Next 10C LOAD Ctr 10D SUBT One 10E STORE Ctr 10F SKIPCOND 000 110 JUMP Loop 111 HALT 112 Addr HEX 118 113 Next HEX 0 114 Num DEC 5 115 Sum DEC 0 116 Ctr HEX 0 117 One DEC 1 118 DEC 10 119 DEC 15 11A DEC 2 11B DEC 25 11C DEC 30 41

4.12 Extending Our Instruction Set Do you think we need more? 42

4.13 A Discussion on Decoding A computer s control unit keeps things synchronized, making sure that bits flow to the correct components as the components are needed. The control unit can be implemented using: hardwired control Implement the control signals using digital logic components microprogrammed control. Small program is placed into read-only memory in the microcontroller 43

4.13 A Discussion on Decoding Hardwired control unit for our simple system would need a 4-to-14 decoder to decode the opcode of an instruction. The block diagram shows a general configuration for a hardwired control unit. 44

4.13 A Discussion on Decoding In microprogrammed control, the control store is kept in ROM, PROM, or EPROM firmware, as shown below. 45

Extending Instruction Set 46

Examples, Instruction Set 47

4.14 Real World Architectures MARIE shares many features with modern architectures but it is not an accurate depiction of them. In the following slides, we briefly examine two machine architectures. We will look at an Intel architecture, which is a CISC machine and MIPS, which is a RISC machine. CISC is an acronym for complex instruction set computer. RISC stands for reduced instruction set computer. We will explore the RISC versus CISC arguments in the Next chapter 48

Chapter 4 Conclusion The major components of a computer system are its control unit, registers, memory, ALU, and data path. A built-in clock keeps everything synchronized. Control units can be microprogrammed or hardwired. Hardwired control units give better performance, while microprogrammed units are more adaptable to changes. 49

Chapter 4 Conclusion Computers run programs through iterative fetchdecode-execute cycles. Computers can run programs that are in machine language. An assembler converts mnemonic code to machine language. The Intel architecture is an example of a CISC architecture; MIPS is an example of a RISC architecture. 50