Computer Organization CSC 405 (VSC) Very Simple Computer.

Slides:



Advertisements
Similar presentations
Chapter 2: Data Manipulation
Advertisements

ARITHMETIC LOGIC SHIFT UNIT
1 Register Transfer &  -operations Computer Organization Computer Architectures Lab REGISTER TRANSFER AND MICROOPERATIONS Register Transfer Language Register.
The CPU. Parts of the CPU Control Unit Arithmetic & Logic Unit Registers.
The CPU Revision Typical machine code instructions Using op-codes and operands Symbolic addressing. Conditional and unconditional branches.
CHAPTER 4 COMPUTER SYSTEM – Von Neumann Model
Stored Program Concept: The Hardware View
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
Dale & Lewis Chapter 5 Computing components. Let’s design a computer Generic CPU with registers −Program counter (PC) – 5 bits (size of addresses) −Instruction.
Computer Organization and Architecture
CPU Fetch/Execute Cycle
SAP1 (Simple-As-Possible) Computer
An Interactive Web-Based Simulation of a General Computer Architecture
CS 1308 Computer Literacy and the Internet Computer Systems Organization.
Computer System Architecture ESGD2204
Information Representation: Machine Instructions
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.
Lecture 1 Introduction to Computing Machinery. Colossus Joseph Marie Jacquard Charles Babbage Augusta Ada Countess of Lovelace.
Von Neumann Machine Objectives: Explain Von Neumann architecture:  Memory –Organization –Decoding memory addresses, MAR & MDR  ALU and Control Unit –Executing.
Chapter 8: The Very Simple Computer
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
General Concepts of Computer Organization Overview of Microcomputer.
The structure COMPUTER ARCHITECTURE – The elementary educational computer.
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 Architecture Memory, Math and Logic. Basic Building Blocks Seen: – Memory – Logic & Math.
Computer Science 101 Computer Systems Organization ALU, Control Unit, Instruction Set.
A summary of TOY. 4 Main Components Data Processor Control Processor Memory Input/Output Device.
Computer Hardware A computer is made of internal components Central Processor Unit Internal External and external components.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI N305 Information Representation: Machine Instructions.
September 26, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 2: Implementation of a Simplified Computer Jeremy R. Johnson Wednesday,
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.
Computer Organization CDA 3103 Dr. Hassan Foroosh Dept. of Computer Science UCF © Copyright Hassan Foroosh 2002.
20 October 2015Birkbeck College, U. London1 Introduction to Computer Systems Lecturer: Steve Maybank Department of Computer Science and Information Systems.
Dale & Lewis Chapter 5 Computing components
Lecture 5 Computer Hardware. von Neumann Architecture.
Our programmer needs to do this !
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Instruction.
Computer Organization and Assembly Languages Yung-Yu Chuang 2005/09/29
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.
Designing a CPU –Reading a programs instruction from memory –Decoding the instruction –Executing the instruction –Transferring Data to/From memory / IO.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 2 Data Manipulation © 2007 Pearson Addison-Wesley. All rights reserved.
Jeremy R. Johnson William M. Mongan
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
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.
BASIC COMPUTER ARCHITECTURE HOW COMPUTER SYSTEMS WORK.
Lec 4-2 Five operations of the machine cycle Fetch- fetch the next program instruction from memory. (PC+1); instruction to IR Decode- decode the instruction.
Stored Program Concept Learning Objectives Learn the meaning of the stored program concept The processor and its components The fetch-decode-execute and.
CS 270: Mathematical Foundations of Computer Science
What Computers Can and Cannot Do
Control Unit Lecture 6.
Lesson Objectives A note about notes: Aims
Computer Organization and Design
BASIC COMPUTER ORGANIZATION AND DESIGN
Introduction to Computing Machinery
MARIE: An Introduction to a Simple Computer
Systems Architecture I (CS ) Lecture 2: A Simplified Computer
von Neumann Architecture CPU
CDCA 2203 Elements of Computer Architecture Open University Malaysia
MARIE: An Introduction to a Simple Computer
Lecture 6 CdM-8 CPU overview
Computer Organization and Assembly Languages Yung-Yu Chuang 2005/09/29
A Level Computer Science Topic 5: Computer Architecture and Assembly
Information Representation: Machine Instructions
Objectives Describe common CPU components and their function: ALU Arithmetic Logic Unit), CU (Control Unit), Cache Explain the function of the CPU as.
Little Man Computer.
Presentation transcript:

Computer Organization CSC 405 (VSC) Very Simple Computer

Very Simple Computer (VSC) For detailed design information on the VSC, please read the Very Simple Computer Overview. The VSC is a very impractical computer system with a single Bus, a 32 8-bit Word memory, switch/LED input/output, supporting 8 instructions. As simple as it is, the VSC is a complete representation of the Von Neumann Architecture. Registers: PC - program counter IR - instruction register MAR - memory address register LAT1 - latch 1, ALU input register LAT2 - latch 2, ALU input register ACC - accumulator, ALU output register VSC Functional Units: I/O - input output unit CU - control unit MU - memory unit ALU - arithmetic/logic unit

A Walk through the Fetch/Execute Cycle MAR <- PC IR <- MEM[MAR] PC <- PC+1 MAR <- IR 0-4 LAT1 <- MEM[MAR] LAT2 <- ACC EXE en

The Instructions of the VSC The eight instructions of the VSC are based on the Post/Turing language. These instructions form a complete set of operations. While not very practical, the operations of the Post/Turing language can be used to emulate any computable function. LDA - load the accumulator with a word from memory (selected by MAR) STA - store the word in the accumulator into memory (at address in MAR) ADD - add LAT1 and LAT2 and store the result into the accumulator (ACC) CMP - complement (bit inverse) the value in LAT1 and store in accumulator BNN - if the MSB of ACC is zero (0) replace PC with address in IR SHL - perform an arithmetic shift left on the value in LAT1 SHR - perform an arithmetic shift right on the value in LAT1 HLT - stop the fetch/execute cycle (for VSC set PC to 11111)

Register Transfers for Instruction Executions 000 LDA ACC <- MEM[MAR] 001 STA MEM[MAR] <- ACC 010 ADD ACC <- LAT1+LAT2 011 CMP ACC <- LAT1 100 BNN IF ACC 7 =0 THEN PC <- IR SHL ACC <- 2*LAT1 110 SHR ACC <- LAT1/2 111 HLT PC < OpCode ASM Register Transfer There is a different register transfer operation for each of the eight instructions of the VSC. The Control Unit is a combinatorial circuit (encoder) that activates the read and write enable lines that correspond to the operation indicated by the OpCode.

Implementing the Register Transfers in Hardware We have defined the registers for the VSC, the functional blocks (units) and the logic for the fetch/execute cycle. Now we need to design the circuitry that will invoke these register transfers. There are 7 steps in the fetch/execute cycle. We will use a divide-by-eight counter to generate the Read and Write enable signals for each step start 1 MAR <- PC 2 IR <- MEM[MAR] 3 PC <- PC+1 4 MAR <- IR LAT1<- MEM[MAR] 6 LAT2<- ACC 7 EXE en 8 No Op Time MAR RE PC RE PC WE PC INC IR RE IR WE LAT1 RE LAT2 RE MEM RE MEM WE ACC RE ACC WE EXE EN

555 Timer Divide by 8 Counter 3-to-8 Decoder MAR RE PC RE PC WE PC INC IR RE IR WE LAT1 RE LAT2 RE MEM RE MEM WE ACC RE ACC WE EXE EN The clock pulses that drive the divide-by-eight counter can be produced with a timer circuit (built from a  A555). The divide-by-eight counter is available in a single TTL IC (7493). The 3-to-8 decoder can be built by inverting the outputs of a popular decoder IC (74138).

A similar circuit can be built to generate the control signals needed to implement each of the eight instructions of the VSC. In this case, the control lines input to the 3-to-8 decoder come directly from the OpCode of the current instruction in IR LDA ACC <- MEM[MAR] 001 STA MEM[MAR] <- ACC 010 ADD ACC <- LAT1+LAT2 011 CMP ACC <- LAT1 100 BNN if ACC 7 =0 then PC<-IR SHL ACC <- 2*LAT1 110 SHR ACC <- LAT1/2 111 HLT PC < OpCode ASM Register Transfer Note: Enable lines in common with those in the fetch circuit must be connected through OR gates. MEM RE 3-to-8 Decoder IR OpCode ACC RE ACC WE MEM RE MEM WE PC RE IR WE ADD EN CMP EN SHL EN SHR EN HLT ACC 7

We can define an assembler to write programs for the VSC. This assembler will be used to help us manually develop machine code (1’s and 0’s) for the VSC. The best way to become familiar with the VSC assembler is by reviewing a few examples: In our first example we will write a program to add the values 6 and 3. We will preload these values into memory labeled X and Y and have the program store the result in Z. VSC ASM Addr Data/Instr LDA X ADD Y STA Z HLT X Y Z Note that the assembly language commands are simply the 8 operations we defined for the VSC and their corresponding op-codes are the 3 highest-order bits of each instruction. The program is placed in memory with the 1st instruction at address Upon completion the VSC should hold the value at memory address

The next example is a program that checks an input value X. If X is even then it is divided by 2 otherwise it is multiplied by 2. The result replaces X. In this example X=7. LDA X SHR SHL STA Y LDA X CMP ADD ONE ADD Y BNN EVEN LDA X ODD SHL LDA ZERO BNN SAVE EVEN LDA X SHR SAVE STA X HLT X [INPUT] Y ONE ZERO First the value of X is loaded into the accumulator. Then it is divided and multiplied by 2. The value of X is subtracted from this result (Y). If the difference is negative then X was odd so X is loaded and multiplied by 2. The program then jumps to the address labeled SAVE. If the difference is zero (i.e. not negative) then X was even so X is loaded and divided by 2. The program then saves the result back into X. Homework: Write a VSC assember program that computes the sum of the first 10 integers. Use the pseuodo-code as shown in the last two examples.