A summary of TOY. 4 Main Components Data Processor Control Processor Memory Input/Output Device.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

Central Processing Unit
ARITHMETIC LOGIC SHIFT UNIT
Computer Organization and Architecture
Instruction Set Architecture & Design
Room: E-3-31 Phone: Dr Masri Ayob TK 2123 COMPUTER ORGANISATION & ARCHITECTURE Lecture 5: CPU and Memory.
CHAPTER 4 COMPUTER SYSTEM – Von Neumann Model
Execution of an instruction
TK 2633 Microprocessor & Interfacing Lecture 3: Introduction to 8085 Assembly Language Programming (2) 1 Prepared By: Associate Prof. Dr Masri Ayob.
Memory - Registers Instruction Sets
Translating high level language into machine code
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
The processor and main memory chapter 4, Exploring the Digital Domain The Development and Basic Organization of Computers.
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
CEG 320/520: Computer Organization and Assembly Language Programming1 CEG 320/520 Computer Organization and Assembly Language Programming.
CH12 CPU Structure and Function
COMPUTER INSTRUCTIONS
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Lecture 18 Last Lecture Today’s Topic Instruction formats
The Structure of the CPU
Machine Instruction Characteristics
Computer Systems Organization CS 1428 Foundations of Computer Science.
Stack Stack Pointer A stack is a means of storing data that works on a ‘Last in first out’ (LIFO) basis. It reverses the order that data arrives and is.
The CPU Central Processing Unit. 2 Reminder - how it fits together processor (CPU) memory I/O devices bus.
Chapter 4 The Von Neumann Model
Chapter 8: The Very Simple Computer
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
Execution of an instruction
Module : Algorithmic state machines. Machine language Machine language is built up from discrete statements or instructions. On the processing architecture,
1 Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can be specified with register transfer statements.
Computer Organization CSC 405 (VSC) Very Simple Computer.
Computer Studies/ICT SS2
Computer Organization CDA 3103 Dr. Hassan Foroosh Dept. of Computer Science UCF © Copyright Hassan Foroosh 2002.
Dale & Lewis Chapter 5 Computing components
Von Neumann Model Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens The Stored Program Computer 1945: John von Neumann –
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Chapter 3 : Top Level View of Computer Functions Basic CPU function, Interconnection, Instruction Format and Interrupt.
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
What is a program? A sequence of steps
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.
Processor Organization
Computer Organization Instructions Language of The Computer (MIPS) 2.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
Basic Computer Organization and Design
Basic Processor Structure/design
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Micro-Operations A computer executes a program Fetch/execute cycle
Chapter 4 The Von Neumann Model
William Stallings Computer Organization and Architecture
Chapter 4 The Von Neumann Model
The Processor and Machine Language
Chapter 4 The Von Neumann Model
CS149D Elements of Computer Science
The Von Neumann Model Basic components Instruction processing
BIC 10503: COMPUTER ARCHITECTURE
CDCA 2203 Elements of Computer Architecture Open University Malaysia
Central Processing Unit
Computer Architecture
By: A. H. Abdul Hafez Computer Architecture and Organization: L06: Stored program and Instruction code.
Chapter 4 The Von Neumann Model
Chapter 14 Control Unit Operation
The Stored Program Computer
Basic components Instruction processing
CPU Structure and Function
A Top-Level View Of Computer Function And Interconnection
Information Representation: Machine Instructions
Computer Operation 6/22/2019.
Presentation transcript:

A summary of TOY

4 Main Components Data Processor Control Processor Memory Input/Output Device

Data Processor The data processor contains: –Sixteen 16-bit registers –ALU: Arithmetic Logic Unit containing circuits for performing arithmetic and logical functions –TEMP: a temporary register used by the ALU in computations

Control Processor The control processor is the hardware needed to perform the instruction execution cycle and to execute operations

Control Processor The control processor contains: –PC: Program Counter, containing the address of the next instruction –MAR: Memory Address Register, holds the address of the memory location to be accessed –MBR: Memory Buffer Register, holds the value extracted from, or to be placed into a location specified by the MAR –IR: Instruction Register, holds the current instruction

Memory

Memory Memory is used to store Instructions and Data –Data is stored sequentially from location 00 onwards –Instructions are stored sequentially from location 10 onwards Has 16 bit memory with each memory location labelled with an address between 00 and FF

Input/Output Devices I/O Devices are used in Read and Write operations –Read user input –Write output to the screen

Fetch-Execution Cycle Fetch instruction from memory then execute the instruction: 4 step cycle 1: Transfer contents of PC to MAR to prepare from reading the next instruction [pc] -> [mar] 2: Contents of MAR used as an address in memory. The contents of the memory location (an instruction) are transferred to the MBR mem[[mar]] -> [mbr] 3: Instruction transferred to IR for execution [mbr] -> [ir] 4: PC incremented by 1 and instruction code in IR is executed [pc]+1 -> [pc]

TOY instruction representation Each instruction consists of 4 hex digits. The left-most digit encodes one of the 16 opcodes The second left-most digit refers to one of the 16 registers, which we refer to as the destination register (d) The two right-most digits depend on the opcode being used, as each opcode has a unique format

TOY instruction representation Example: Instruction : opcode 1: Add 4: store result in register 4 6: use value stored in register 6 2: use value stored in register 2 Add value of register 6 to register 2 and put the result in register 4 OpcodeDestination Source (s) Source (t) Format 1:

TOY instruction representation Example: Instruction : opcode 9: Store 4: use contents of register 4 62: store in memory location 62 Store value of register 4 in memory location 62 OpcodeDestinationAddress Format 2:

TOY instruction representation Special Instructions –Halt: 0000 The first (left-most) 0 is interpreted as ‘quit the program’, the program quits, and the other 3 digits are not read –Jump: E500 The first E is interpreted as JUMP (got to a set instruction), 5 is interpreted as the instruction to go to, the program jumps to this instruction, and the other 2 bits are not read

Operations: Arithmetic Opcode 1: Add –Example: 1CAB –Add contents of registers A and B, and store the result in register C Opcode 2: Subtract –Example: 2CAB Subtract contents of register B from contents of register A, and store the result in register C Example Programs - Page 5

Operations: Logical Opcode 3: AND –Determines if the integer is Odd (returns 1) or even (returns 0) –Example: 3BA1 –AND the contents of register A and 1, and store the result in register B Example Programs - Page 6

Operations: Logical Opcode 4: XOR –Changes the sign of an integer, positive becomes negative and negative becomes positive –Example: 4BAF –XOR the contents of registers A and F, and store the result in register B Example Programs - Page 6

Operations: Shift Opcode 5: Left Shift –Shift bits to the left, add padding (0’s) to the right. –Left shift by 1 is equivalent to multiplying by 2 –Left shift by n is equivalent to multiplying by 2 n –Example: 5AA2 –Contents of register A left shifted by contents of register 2, results stored back into register A Example Programs - Page 7

Operations: Shift Opcode 6: Right Shift –Shift bits to the right, add padding (0’s or 1’s depending on the sign bit) to the left. –Right shift by 1 is equivalent to dividing by 2 (and throw away the remainder) –Right shift by n is equivalent to dividing by 2 n (and throw away the remainder) –Example: 6AA2 –Contents of register A right shifted by contents of register 2, results stored back into register A Example Programs - Page 7

Operations: Shift Right Shift

Operations: Move Opcode 7: Load Address –Load a memory address to a register. This opcode only permits 8bit integers (rather than the 16bit capacity) Opcode 8: Load –Load data from memory to registers Opcode 9: Store –Store data from registers to memory Opcode A& B: Load Indirect & Store Indirect –Allows manipulation of memory addresses –Can deal with arrays Example Programs - Page 8

Operations: Control Opcode C: Branch Zero –If a given register has a value of 0, reset the PC to a given address (Use branches like IF statements) Opcode D: Branch Positive –If a given register has a positive integer value, reset the PC to a given address Opcode E: Jump –Reset the PC to the contents of a given register Opcode F: Jump & Link –PC is examined and its value stored in a given register. PC then reset to desired address Example Programs - Page 9

Operations: Idioms Register-to-Register Transfer –Copies a value from one register to another register. –Example: 1201 Copies the value of register 1 to register 2, by adding the value of register 1 to register 0 (which relies on register 0 always being 0) GoTo –Directly changes the PC –Example: C0F0 –Changes PC to F0 since register 0 is always 0 NoOp –No operation performed, space filler. –Example: 1000