CSC321 Making a Computer Binary number system → Boolean functions Boolean functions → Combinational circuits Combinational circuits → Sequential circuits.

Slides:



Advertisements
Similar presentations
Assembly Language.
Advertisements

Instruction Set Design
Control path Recall that the control path is the physical entity in a processor which: fetches instructions, fetches operands, decodes instructions, schedules.
PART 5: (2/2) Processor Internals CHAPTER 15: CONTROL UNIT OPERATION 1.
ARITHMETIC LOGIC SHIFT UNIT
Processor System Architecture
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
Execution of an instruction
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
Computer Organization and Architecture
Processor Structure & Operations of an Accumulator Machine
Micro-operations Are the functional, or atomic, operations of a processor. A single micro-operation generally involves a transfer between registers, transfer.
Bus Architecture Memory unit AR PC DR E ALU AC INPR 16-bit Bus IR TR
Computer System Architecture ESGD2204
Machine Instruction Characteristics
CSC321 Where We’ve Been Binary representations Boolean logic Logic gates – combinational circuits Flip-flops – sequential circuits Complex gates – modules.
Bus Architecture Memory unit AR PC DR E ALU AC INPR 16-bit Bus IR TR
Chapter 4 MARIE: An Introduction to a Simple Computer.
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.
M. Mateen Yaqoob The University of Lahore Spring 2014.
Lec 5 Basic Computer Organization
Computer Architecture 2 nd year (computer and Information Sc.)
M. Mateen Yaqoob The University of Lahore Spring 2014
ECEG-3202 Computer Architecture and Organization Chapter 6 Instruction Sets: Addressing Modes and Formats.
Overview von Neumann Architecture Computer component Computer function
Instruction.
Bus Architecture Memory unit AR PC DR E ALU AC INPR 16-bit Bus IR TR
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
Computer Architecture Lecture 4 by Engineer A. Lecturer Aymen Hasan AlAwady 17/11/2013 University of Kufa - Informatics Center for Research and Rehabilitation.
PART 4: (1/2) Central Processing Unit (CPU) Basics CHAPTER 12: P ROCESSOR S TRUCTURE AND F UNCTION.
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.
8085 processor.
Control Unit Operations Chapter10:. What is Control Unit (CU)?(1)  Part of a CPU or other device that directs its operation.  Tells the rest of the.
Chapter 10 Control Unit Operation “Controls the operation of the processor”
Processor Organization and Architecture Module III.
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.
Basic Computer The following discussions are based on a fictitious computer called “Basic Computer” by the author of the textbook It’s a much better way.
BASIC COMPUTER ARCHITECTURE HOW COMPUTER SYSTEMS WORK.
Chapter 5 Computer Organization TIT 304/TCS 303. Purpose of This Chapter In this chapter we introduce a basic computer and show how its operation can.
Types of Micro-operation  Transfer data between registers  Transfer data from register to external  Transfer data from external to register  Perform.
Functions of Processor Operation Addressing modes Registers i/o module interface Memory module interface Interrupts.
Computer Architecture. Instruction Set “The collection of different instructions that the processor can execute it”. Usually represented by assembly codes,
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
Displacement (Indexed) Stack
Basic Computer Organization and Design
Edexcel GCSE Computer Science Topic 15 - The Processor (CPU)
Computer Organization and Design
William Stallings Computer Organization and Architecture 8th Edition
Processor Organization and Architecture
Introduction to Micro Controllers & Embedded System Design Stored Program Machine Department of Electrical & Computer Engineering Missouri University.
BASIC COMPUTER ORGANIZATION AND DESIGN
The Processor and Machine Language
Number Representations and Basic Processor Architecture
Processor Organization and Architecture
MARIE: An Introduction to a Simple Computer
ECEG-3202 Computer Architecture and Organization
By: A. H. Abdul Hafez Computer Architecture and Organization: L06: Stored program and Instruction code.
Computer Architecture
A Discussion on Assemblers
ECE 352 Digital System Fundamentals
A Top-Level View Of Computer Function And Interconnection
Chapter 4 The Von Neumann Model
Presentation transcript:

CSC321 Making a Computer Binary number system → Boolean functions Boolean functions → Combinational circuits Combinational circuits → Sequential circuits Sequential/Combinational circuits → Functional units Functional units → Computer architecture

CSC321 Defining a Computer Computer Architecture –Bus –Registers –Register transfer language –Microoperations –Instruction set –Timing and control

CSC321 Instruction Set Instruction (Assembly language statement) –Binary code –Consists of an operation code and operand(s) –Specifies a sequence of microoperations to be executed One high level language (e.g. C++/Java) statement specifies a sequence of instructions –Stored in memory –Note that we are talking about a level higher than RTL but lower than Java, C++, etc.

CSC321 Exercise Start Visual Studio.NET Select “New Project” –Visual C++ Projects Win32 Console Application –Type in a project name (e.g. AssemblyExample) –Browse to a directory (e.g. Desktop) –Press “OK” –Press “Finish”

CSC321 Exercise Modify your main function to look like this: int _tmain(int argc, _TCHAR* argv[]) { int x, y; x = 1; y = 2; x = x + y; return 0; }

CSC321 Exercise Set a break-point on the “int x, y;” line by clicking on that line and pressing F9 –A red circle should appear to the left of the line Run the program by pressing F5 and answering “yes” to the question Open the Debug menu –Select Windows → Disassembly –Select Windows → Registers

CSC321 Exercise In the Watch1 window (lower left) select an empty line (turns blue) and type &x In the Watch1 window (lower left) select an empty line (turns blue) and type &y In the Memory1 window (select tab) enter the smaller of the two hexadecimal numbers next to the &x and &y into the Address field If you want to see the binary (hex) codes for the instructions type an instruction address (next to an assembly language instruction) into the Memory1 window’s address field –Notice that instructions are of varying lengths

CSC321 Exercise Note the value of the EIP register in the Registers window – it matches the value next to the yellow arrow at the left of the assembly code Press F10 and watch the Memory1 window Press F10 again and watch the Memory1 window Press F10 again and watch the EAX register Press F10 again and watch the Memory1 window

CSC321 Exercise What you witnessed was the modification of Pentium processor registers and memory as it executed individual assembly language instructions Note that the Pentium assembly language is extremely complex as it is a powerful processor If you want to learn more, manuals can be downloaded from m

Basic Computer The following discussions are based on a fictitious computer called “Basic Computer” by the author of the textbook It’s a much better way to learn computer architecture concepts than trying to understand the Intel Pentium architecture

Assembly Language Every computer architecture (or family of architectures) has its own unique assembly language Unlike Java, you should not learn assembly language syntax, data types, etc. You should learn to program/think at the assembly language level –It’s a way of thinking that requires intimate knowledge of the underlying hardware architecture

Assembly Language Instructions Each instruction has two basic parts –Operation code (opcode) What the instruction wants the processor to do –Operand(s) (registers, memory addresses) Data location that the instruction wants the processor to manipulated Some operands will be explicit while others will be implicit (implied by the opcode)

Assembly Language Instructions n-bit instruction format Example – 16 bit instruction opcodeoperand/address 0m+1mn-1 opcodeoperand/address (n-1)-(m+1) opcodes 2 (m+1) addresses 2 4 = 16 opcodes 2 12 =4096 addresses

Assembly Language Instructions Instructions within the same Assembly language may be of differing lengths –i.e. not all instructions utilize the same number of bits as we saw with the Pentium

Internal Operation To execute an assembly language instruction the processor goes through 4 steps –Fetch an instruction from memory –Decode the instruction –Read the operands from memory/registers –Execute the instruction This is often referred to as the Fetch-Execute cycle or the Instruction cycle To execute a program the processor repeats this cycle until a halt instruction is reached

Internal Operation All this is under the control of the Control Unit This is the component that decodes the instruction and sends out microoperations to the rest of the hardware –The control unit can be hardwired Made up entirely of sequential circuits designed to do precisely the fetch-execute steps – fixed instruction set –The control unit can be microprogrammed A small programmable processor within the processor – programmable instruction set More on this later

Addressing Modes In designing a computer architecture the designer must specify the instruction set –Opcode/operand pairs In specifying operands there are a number of alternatives –Immediate instructions –Direct address operands –Indirect address operands

Immediate Instruction The 2 nd part of the instruction is the operand (rather than the address of the operand) An example might be an instruction that adds a constant to a register add 3 –The “3” is the value we want to add, not an address in memory

Direct Address Instruction The 2 nd part of the instruction is the memory address of operand An example might be an instruction that adds a value in memory to a register add 0x30213 –The “0x30213” is the memory address of the value that we want to add

Indirect Address Instruction The 2 nd part of the instruction is the memory address of the location that holds the memory address of the operand An example might be an instruction that adds a value in memory to a register add 0x30213 –The “0x30213” is a memory address that holds the memory address of the value that we want to add

Addressing Modes Iopcodeaddress 0addc3 0add0x331add0x33 0x42 0x33 0x42 0x33 0x88 0x42 Operand Immediate DirectIndirect Mode bit

Addressing Modes The term effective address refers to the actual address of the operand –For the previous example Immediate address mode –Effective address is the instruction itself Direct address mode –Effective address is the memory location 0x33 Indirect addressing mode –Effective address is the memory location 0x42

Addressing Modes Something in the instruction word will specify which addressing mode is applicable –The operand itself (for immediate instructions) –A designated bit (for direct vs. indirect address instructions)

Addressing Modes Indirect addressing is a convenient way to implement arrays (which are nothing more than pointers to blocks of contiguous memory) Some architectures define additional modes such as “read location then increment” –These are all derivations of the three defined here

Registers In designing a computer architecture the designer must specify the register set There are essentially two categories –Special purpose registers –General purpose registers

Special Purpose Registers Program Counter (PC) –Holds the memory address of the next instruction of our program Memory Address Register (AR) –Holds the address of a location in memory that we want to access (read/write) The size of (number of bits in) these two registers is determined by the number of memory addresses in our architecture

Special Purpose Registers Instruction Register (IR) –Holds the instruction (opcode/operand) we are about to execute Data Register (DR) –Holds the operand read from memory to be sent to the ALU Accumulator (AC) –Holds an input to the ALU and the output from the ALU

Special Purpose Registers Input Register (INPR) –Holds data received from a specified external device Output Register (OUTR) –Holds data to be sent to a specified external device

General Purpose Registers Temporary Register (TR) –For general usage either by our program or the architecture

Registers These registers (shown previously) are specified for the fictitious architecture given in the textbook All architectures will have these in some form Most architectures will have more than just these –More general purpose registers –Stack pointers –Interrupts –Program status bits –Multiple I/O ports –Timers –etc. To effectively program the architecture (in assembly language) you need to be aware of all the available registers and their usage High level language compilers possess this knowledge

Bus In designing a computer architecture the designer must specify the bus layout –The size of the bus (in bits) –What is connected to the bus –Access control to the bus Recall that a bus is an efficient alternative to lots of wires when it comes to transferring data between registers, control units, and memory locations

Bus Architecture Memory unit 4096x16 AR PC DR AC INPR IR TR OUTR ALU E 16-bit Bus address clock S2S2 S1S1 S0S Access Select