Eng. Ayman Metwali

Size: px
Start display at page:

Download "Eng. Ayman Metwali"

Transcription

1 1

2 Recall the Von Neumann model : A Memory stores both data and program instructions (both binary!) The CPU fetches, decodes, and executes program instructions sequentially The CPU components can be divided into two main parts: The datapath: It groups the arithmetic-logic unit (arithmetic and logical operations), registers (storage units) and data buses (moving data from place to place). The control unit: It is responsible for sequencing operations and making sure the correct data is where it needs to be at the correct time. Registers Registers are places to store a wide variety of data Numerical data, Addresses, Control information, General Purpose registers are the registers available to the programmer. Special Purpose registers registers are those that always stores the same type of data Examples: Index registers, status registers, etc. Recall that registers can be implemented using D Flip-flops! Registers are located on the processor so information can be accessed very quickly The control unit directly accesses data inside the registers Most computers have registers of a certain size (16, 32 or 64 bits) The size of registers fixes the word size Data processing on a computer is usually done on these words (fixed size data) stocked inside the CPU registers The arithmetic Logic Unit ALU The ALU carries out logical and arithmetic operations as directed by the control unit. The Control Unit The control unit is the policeman or traffic manager of the CPU. It fetches and decodes sequentially the instructions stocked in the main memory. It also monitors the execution of these instructions and the transfer of all information. 2

3 The Bus The CPU communicates with the other components via a Bus. A Bus is a set of wires that simultaneously convey a single bit along each line (parallel movement). A Bus connects multiple subsystems within the system A Bus can be Point-to-Point or Common Pathway (also referred to as multipoint bus ) A point-to-point bus connects two specific components multipoint bus is shared by several devices Bus protocols are used to manage the bus access by these devices A typical bus consists of three main components Data lines: are dedicated to moving data (the actual information that must be moved). Control lines: indicate which device has permission to use the bus and for what purpose (reading or writing from memory or from an I/O device, ) Address lines: indicate the location (in memory, for example) that the data should be either read from or written to. Power lines are also required to provide the electrical power necessary 3

4 Buses have also been divided into different types Examples: Processor-memory buses are short, high-speed buses that are closely matched to the memory system on the machine to maximize the bandwidth (data transfer). I/O buses are typically longer than processor-memory buses and allow for many types of devices with varying bandwidths Final Question: What are the differences between a point-to-point bus and a multipoint bus? Sol. Multipoint bus is a shared resource; access to it is controlled through protocols, which are built into the hardware. While Point- to Point bus provides direct connection between two resources. Thus the difference is that point to point is dedicated bus or link between two resources while multipoint bus is shared Final Question: What is the difference between a point to point bus and a multipoint bus? And what are the main three components of a typical bus? Briefly explain each of them. (7.5 Marks) Sol. A point-to-point bus connects two specific components while a multipoint bus is shared by several devices. (3 Mark) The three main components of typical bus are: Data bus: are dedicated to moving data Control bus: indicate which device has permission to use the bus and for what purpose Address bus: indicate the location (in memory, for example) that the data should be either read from or written to. Questions: Final Question: The... of a bus contain information about the location that the data should be either read from or written to. a- control lines c- data lines b- Address lines d- power lines Final Question: The registers are interconnected, and connected with main memory through a: a. common data bus b. CPU c. ALU d. CU Final Question: The CPU shares data with other system components by way of A) a data pulse. B) a data sharing. C) a data bus. D) Not applicable. Final Question: The access to a multipoint bus is controlled through, which are built into the hardware. a) Protocols b) Programs c) Buses d) disk controller Final Question: The groups three CPU major components: the arithmetic-logic unit, registers and data buses. a) datapath b) cache memory c) control unit d) main memory 4

5 Clocks Every computer contains at least one clock that synchronizes the activities of its components. The CPU requires a fixed number of clock ticks to execute each instruction Instruction performance is often measured in clock cycles instead of seconds 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: T= 1/F Example: An 800 MHz clock has a cycle time of 1/(800x 10 6 ) seconds = 1.25 ns. Example 2: If a machine has a 2ns cycle time, then it is a 500MHz machine. It seems reasonable to assume that if we speed up the clock, the machine will run faster? Well yes, BUT: Suppose we want to transfer data from a register (output) to another (input) The data is transferred electrically inside the bus If the clock cycle is less than the propagation delay between the registers we can end up with some values not reaching the destination register (before the next clock tick)! What if we shorten the distance between registers to shorten the propagation delay? We could do this by adding registers between the output registers and the corresponding input registers. But recall that registers cannot change values until the clock ticks, so we have, in effect, increased the number of clock cycles!! So, the time to execute an instruction depends on both The clock cycle time and the number of clock cycles per instruction The time needed to execute a whole program is given by: Interrupts Interrupts: are events that alter(or interrupt) the normal flow of execution in the system. Interrupts can be triggered for a variety of reasons: I/O requests arithmetic errors (such as division by zero) when an invalid instruction is encountered. An interrupt can be initiated by the user or the system. Two types of interrupts Maskable interrupts: disabled or ignored Non-maskable interrupts are high-priority interrupts that cannot be ignored. 5

6 The Input/Output Subsystem A computer communicates with the outside world through its input/output (I/O) subsystem. I/O devices connect to the CPU through various interfaces. I/O can be memory-mapped, where the I/O device behaves like main memory from the CPU s point of view.(its speed but uses up memory space) Or I/O can be instruction-based, where the CPU has a specialized I/O instruction set. (does not use memory space, It requires specific I/O Instructions) Memory Organization and Addressing A Computer memory can be seen as a matrix of bits: a linear array of addressable storage cells that are similar to registers. Each row has a length typically equivalent to the word size of the machine. Two types of memories are available: Byte addressable: Each byte has its own address (each memory row contains 8 bits only) Word addressable: Each word has a unique address (each memory row contains one word that can be lager than 8 bits). What if the word size is larger than a single byte but the system still employ a byte-addressable architecture? Byte addressable: Still each byte has its own address! When accessing a word (that uses multiple bytes), the byte with the lowest address determines the address of the entire word. Now how many addresses do we have in a given memory? And how many address bits? To answer this question we should be aware of: The type of addressing? - word addressable or byte addressable The word size? - Examples: 8, 16, 32, 64 bits? The storage capacity of the memory? - Memory is often referred to using the notation L x W (length x Width) Important: 4M x 16 means the memory is 4M long (number of words) and it is 16 bits wide (word size) 6

7 Example 1: How a 4M x 16 word addressable memory is organized? 16 bits is the word size. 4M means that we have 4 x 2 20 = 2 2 x 2 20 = 2 22 different words. These 2 22 words are numbered from 0 to , each number represents the address of only one word. So each address is represented with at least 22 bits Example 2: How many bits would you need to address a 2M 32 memory if: a) The memory is byte-addressable? b) The memory is word-addressable? Solution: a) There are 2M 4 bytes which equals 2 * 2 20 * 2 2 bytes = 2 23 bytes, so 23 bits are needed for an address b) There are 2M words which equals words = 2 21 words, so 21 bits are required for an address Usually, computers physical Memory (RAM) is not made from a single high capacity chip, but a group of lower capacities chips. Access is more efficient when memory is organized into banks of chips with the addresses interleaved across the chips Example: How to build a 32Kx16 word addressable RAM memory with only 2Kx8 RAM chips? Solution: To create the 32K words, we need 16x2K words. A 32Kx16 word addressable RAM memory can be created with 32 different 2Kx8 RAM chips: We could connect 16 rows and 2 columns of chips together Final Question: How many bits would have been used to address a 2M X 32 Memory if [ 7 MARKS] : a) The memory is byte addressable There are 2M X 4 BYTES = 2 x 2 20 x 2 2 = 2 23, so 23 bits b) The memory is word addressable. 2M words which equals to 2 x 2 20 = 2 21 so 21 bits 7

8 MARIE Introduction We are now familiar with computer components but how these are connected together? How these work together? MARIE stands for: A Machine Architecture that is Really Intuitive and Easy. MARIE will help us to understand how computer functions (even the more complex computers) and how computer components connected together? The MARIE architecture has the following characteristics: Binary, two's complement data representation. Stored program, fixed word length data and instructions. 4K x 16 word-addressable main memory. 16-bit instructions: 4 bits for the opcode, 12 bits for the address. A 16-bit arithmetic logic unit (ALU). Seven registers for control and data movement. Registers and Buses AC: Accumulator, a 16-bit register that holds a conditional operator (e.g., "less than") or one operand of a two-operand instruction. MAR: Memory address register, a 12-bit register that holds the memory address of an instruction or an operand of an instruction. MBR: Memory buffer register, a 16-bit register that holds the data after its retrieval from, or before its placement in memory. PC: Program counter, a 12-bit register that holds the address of the next program instruction to be executed. IR: Instruction register, a 16-bit register that holds an instruction immediately preceding its execution. InREG: Input register, an 8-bit register that holds data read from an input device. OutREG: Output register, an 8-bit register that holds data that is ready for the output device. The MARIE architecture is shown in the figure below: MARIE cannot transfer data or instructions into or out of registers without a bus. In MARIE, we assume a common bus scheme Each device on the bus is identified by a unique number. If the device is required to use the common bus, Its number is set on the control lines. Some direct pathways (without using the common bus) are also available to speed up execution MAR Memory ; AC ALU ; AC MBR ; MBR ALU. 8

9 The Data path in MARIE is shown in this figure Note that a data word (that is an instruction) in the main memory travels a relatively long path before achieving the IR! The Instruction Set Architecture MARIE has a very simple, yet powerful, instruction set. The 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. For MARIE, each instruction consists of 16 bits These bits are organized as follows: Opcode: 4 bits (bits 12 to 15), specifies the instruction to be executed (which allows for a total of 2 4 =16 instructions, but only 13 are used) Address: 12-bits (bits 0 to 11), forms an address. The fundamental MARIE instructions are: 9

10 Example: Consider the following binary instruction: What is the job of this instruction? Solution: The first four MSB forms the opcode It corresponds to a LOAD instruction. The remaining 12 bits indicate the address of the value we are loading, which is address 3 in main memory. This instruction causes the data value found in main memory, address 3, to be copied into the AC One important instruction is SKIPCOND When the Skipcond instruction is executed, the value stored in the AC must be inspected. The next instruction is skipped (resp. not skipped), if the condition tested is True (resp. False). Bits 11 and 10 (say b 11 b 10 ) in the AC specify the condition to be tested, if: - b 11 b 10 = 00: The CPU tests if AC < 0 - b 11 b 10 = 01: The CPU tests if AC = 0 b 11 b 10 = 10: The CPU tests if AC > 0 Example: Consider the following binary instruction: What is the job of this instruction? Solution: The opcode 1000 corresponds to a skipcond b 11 b 10 = 10, so the instructions job is to skip the next instruction if AC > 0. In general we use: SKIPCOND 000 which means skip the next instruction if the AC <0. SKIPCOND 400 which means skip the next instruction if the AC =0. SKIPCOND 800 which means skip the next instruction if the AC >0. Note that 000, 400 and 800 are in base 16, They are equivalent to 12bits (Address part)! 10

11 A Simple Program The figure below shows a program written in assembly language for MARIE What does this program do? This program simply adds two numbers and stores the result in the main memory. It loads the value stored at the location address into AC (the value is = ) It adds this value to the value stored at the location address (the value is FFE9 16 = (-23) 10 ) Stores the sum into the location address So what will be stored in the location address ? Now let us discover what happens during each Fetch, decode, execute cycle. Question. List the hexadecimal code for the following program (hand assemble it). Ans What are the contents of the symbol table for the preceding program? Sol. 11

12 Questions: Question. Decipher the following MARIE machine language instructions (write the assembly language equivalent): i) ii) iii) Sol. i) Store 007 ii) Jump 00B iii) Add 009 Question. Write the following code segment in MARES assembly language Sol. If x>0 then Z = x + y End if; Question. List the separate steps to do each of the following using Marrie's commands: Sol. 1- x := 1 load one store x 2- x > 10 Load X subt 10 skipcond X := X + 1; Load x Add one Sotre x Advanced Question: Write the following code segment in MARES assembly language Sol. If x>1 then z = x + y Else if x<1 then z = x - y Else Z = x End if Final Question: Write the proper code to implement the expression: A= 2B - (D - E) using MARIE ISA, and write their proper addresses, given than the following directive is given : ORG 10A. Sol. Load B Add B Subt D Add E Store A Question. Write the following code segment in MARES assembly language Sol. If x>1 then Z = x + y End if; Question. Write the following code segment in MARES assembly language Sol. If x>1 then z = x + y Else z = x - y End if Advanced Question: Write the following code segment in MARES assembly language Sol. if x>1 then y= x+x; x=0; endif; y=y+1; 12

13 Final Question: Write the following code segment in MARES assembly language [ 8 marks] If x > 1 then Y = X + X; X = 0; End if ; Y = Y +1; Sol : Question. Write the following code segment in MARIE assembly language: (A hint, not a solution, was given to students on this problem.) Sum := 0; for X := 1 to 10 do Sum := Sum + X; 13

14 Final Question: Given the following MARIE assembly program: ORG 200 Load Var1 Store X Subt Var2 SkipCond 400 Jump Finish1 Store Y Finish1, Load Y Output Clear Halt Y, Dec 5 X, Dec 0 Var1, Dec 5 Var2, Dec 1 Instructions Content of The AC a) At what address does the program begin? At address 200 b) Give the content of the AC (accumulator register) after the execution of each of the above program s selected instructions. To do so, copy the above table in your answer sheet and replace the? symbols with the appropriate decimal values. Hint: Write NOT EXECUTED in front of a non-executed instruct Instructions Content of The AC ORG 200 Load Var1 5 Store X 5 Subt Var2 4 SkipCond Jump Finish1 4 Store Y Finish1, Load Y 5 Output 5 Clear 0 Halt Y, Dec 5 X, Dec 0 Var1, Dec 5 Var2, Dec 1 NOT EXECUTED 14

15 Final Question: Given the following MARIE assembly program: Instructions Content of the AC ORG 200 XXXXXXXXXXXXXXXXXXXXX Load X? Subt TEN? IF, Skipcond 800? Jump ELSE? Load X? Subt Y? Jump END? ELSE, Load X? Add Y? END, Store Z? Output? Halt XXXXXXXXXXXXXXXXXXXXX X, Dec 15 XXXXXXXXXXXXXXXXXXXXX Y, Dec 4 XXXXXXXXXXXXXXXXXXXXX TEN, Dec 10 XXXXXXXXXXXXXXXXXXXXX Z, Dec 0 XXXXXXXXXXXXXXXXXXXXX a) Give the content of the AC (accumulator register)after the execution of each of the above program s selected instructions. To do so, copy the above table in your answer sheet and replace the? symbols with the appropriate decimal numbers. Hint: Write NOT EXECUTED in front of a non-executed instruction. Instructions Content of the AC ORG 200 XXXXXXXXXXXXXXXXXXXXX Load X 15 Subt TEN 5 IF, Skipcond Jump ELSE NOT EXECUTED Load X 15 Subt Y 11 Jump END 11 ELSE, Load X NOT EXECUTED Add Y NOT EXECUTED END, Store Z 11 Output 11 Halt XXXXXXXXXXXXXXXXXXXXX X, Dec 15 XXXXXXXXXXXXXXXXXXXXX Y, Dec 4 XXXXXXXXXXXXXXXXXXXXX TEN, Dec 10 XXXXXXXXXXXXXXXXXXXXX Z, Dec 0 XXXXXXXXXXXXXXXXXXXXX a) What is the output of this program? (2 Marks) The output is : M[X]-M[Y]=15-4 = 11. b) What would be the new output if X, Dec 15 is replaced by X, Dec 9? The program adds instead of subtracting. The new output is =

16 Question. Giving the following code, what is the equivalent equation? Final Question: MARIE Assembly program (12.5 Marks) Consider the following program written in MARIE assembly language: Org 100 Load X Subt Y Store Z if, Skipcond 000 Jump Else Then, Clear Subt Z Else, Output Halt X, DEC 3 Y, DEC 5 Z, HEX 0000 a) What is the job of the underlined instructions? b) What is the data value stored at the address Z after the execution of Store Z instruction? And what is the value stored in the AC after the execution of Store Z instruction? (2 Marks) The value is the same as in AC. It is 3-5 = -2 in decimal. c) What is the output of this code in decimal? In hexadecimal? (2 Marks) The output of this code is 2 in decimal and 0002 in hexadecimal. d) So what does this code do in general? (2 Marks) This code calculates X-Y. e) What is the RTL of Halt instruction? (1.5 Marks) Halt instruction does not include any RTL. 16

17 Register Transfer Notation MARIE instruction appears to be very simplistic Actually, at the component level, each instruction involves multiple operations called microoperations Register Transfer Language (RTL), or Register Transfer Notation (RTN) specifies the exact sequence of microoperations that are carried out by an instruction. In the MARIE RTL we will use the following : 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 In the following few slides we will present the RTL for each of the instructions in the ISA for MARIE Load X (loads the contents of memory location X into the AC) MAR X Place the address X in MAR; MBR M[MAR] The data M[MAR] at location address MAR is moved into the MBR; AC MBR The content of MBR is placed in the AC. Store X (stores the contents of AC into the memory location X) MAR X Place the address X in MAR; MBR AC M[MAR] MBR Place the content of AC in MBR Place the content of MBR in the memory location MAR (M[MAR] is replaced by MBR) Add X (The data value stored at address X is added to the AC). MAR X Place the address X in MAR; MBR M[MAR] Place the data M[MAR] at location address MAR in MBR; AC AC + MBR Place the sum AC + MBR in AC Subt X (The data value stored at address X is subtracted from AC). MAR X Place the address X in MAR; MBR M[MAR] Place the data M[MAR] at location address MAR in MBR; AC AC - MBR Place AC - MBR in AC Input (Inputs a value from the keyboard into AC) AC InREG Place the content of InREG (contains the input) in the AC. Output (Output the value in AC to the display) OutREG AC Place the content of AC (contains the output) in the OutREG (to sent data to the display) Halt (Terminate the program) no need for any RTL! Jump X (unconditional branch to the given address, X) PC X Load X into the PC Skipcond if IR[11 10] = 00 then {if bits 10 and 11 in the IR are both 0} if AC < 0 then PC PC+1 else if IR[11 10] = 01 then {if bit 11 = 0 and bit 10 = 1} if AC = 0 then PC PC

18 else if IR[11 10] = 10 then {if bit 11 = 1 and bit 10 = 0} if AC > 0 then PC PC + 1 Important Notes Any instruction is firstly placed into the instruction register IR where: - IR[15-12] contains the opcode - IR[11-0] contains the operand (address) In all the previous RTL, X can be replaced by IR[11-0]! Example: - The RTL for Jump X can be written as follows: PC IR[11-0] MARIE, like any other computer architecture, follow the basic machine cycle: The fetch, decode, and execute cycle 18

19 Interrupts An important issue (that is not covered here for MARIE) is interrupt handling Most computers provide a way of interrupting a running program Examples of interrupts: A user break is issued (e.g., Ctrl+C) I/O is requested by the user or a program A critical error occurs Practically, when an interrupt occurs a special bit in the status register or flag register of the CPU is set. The CPU checks this bit at the beginning of every machine cycle If the bit is set, the CPU processes an interrupt as follows: Pause the execution of the current program Run the interrupt s appropriate routine Continue the execution of the previously paused program (after finishing the interrupt s routine) If the bit is not set, the CPU performs a normal new fetch, decode, execute cycle of the program currently being executed. When the CPU finishes the interrupt s routine, it must return to the exact point at which it was running in the original program. Before the CPU switches to the interrupt service routine, it must save: The contents of the PC The contents of all other registers in the CPU Any status conditions that exist for the original program. 19

20 What do Assemblers do? Assembly language can be understood by the programmer but not the computer! Assembly language must be converted into Machine Codes (binary codes) before being executed or even stored in the main memory. An Assembler is used to translate assembly language into machine code It reads a source file (assembly program) and convert it to an object file (Machine code) Assembler VS Compiler An assembler translates each mnemonic instruction (written in assembly) to exactly one machine code. With compilers, this is not usually the case Going back to our simple program, what really happens inside the CPU during each fetch, decode, execute cycle? Load 104: Add 105: Store 106: An assembler directive is an instruction that is not supposed to be translated into machine code 20

21 Consider the following program: 100 Load X 101 Add Y 102 Store z 103 OUTPUT 104 Halt X, 105 HEX 0023 Y, 106 HEX 0023 Z, 107 HEX 0000 The following table represent the RTN for Load instruction during fetch, decode, execute cycle Using the above code write the missing values and Steps in the following table: Step RTN PC IR MAR MBR AC (initial values) 100 MA RPC 100 IR M [MAR] 100 PC PC + 1 MAR IR[11-0] (Decode IR[15-12] MBR M[MAR] AC MBR Step RTN PC IR MAR MBR AC (initial values) 100 Fetch MA RPC IR M [MAR] PC PC Decode MAR IR[11-0] (Decode IR[15-12] Get operand MBR M[MAR] Execute AC MBR

22 Example: base 16 is the default base when writing assembly program for MARIE, to specify the used base we can use constant directives such as DEC (decimal) or HEX (Hexadecimal) In assembly language we can also use labels in order to clarify the program Extending our instruction set For MARIE, we have seen only 9 instructions while we have 4 bits, so we can have 16 different instructions. We will now extend our ISA by adding 4 new instructions: JnS, Clear, LoadI, StoreI, AddI and JumpI Instruction Number (hex) 0 A B C D E Table 4.6: MARRIE's Extended Instruction Set Instruction Meaning JnS X Clear AddI X JumpI X LoadI X StoreI X Store the PC at address X and Jump to X + 1 Put all zeros in AC. Add indirect: Go to address X. Use the value at X As the actual address of the data Operand to add to AC. Jump indirect: Go to address X. Use the value at X As the actual address of the location to Jump to. Load indirect: Go to address X. Use the value at X as the actual address of the operand to Load into the AC. Store indirect: Go to address. Use the value at X and the destination address for storing The value in the accumulator. JnS: Jump-and-Store instruction Allows us to store a pointer and then proceeds to set the PC to a different instruction This enables us to call procedures and other subroutines, and then return to the calling point in our code once the subroutine has finished. Clear: This instruction moves all zeros into the accumulator. This saves the machine cycles that would otherwise be expended in loading a 0 operand from memory. 22

23 So far, all of the MARIE instructions that we have discussed use a direct addressing mode. This means that the address (not the value!) of the operand is explicitly stated in the instruction. It is often useful to employ a indirect addressing The address of the address of the operand is given in the instruction. This means that the content of the given address is the address of the needed value. If you have ever used pointers in a program, you are already familiar with indirect addressing. LoadI, StoreI use indirect addressing Their RTL are shown in the table below What are the differences between LoadI X and Load X? StoreI X and Store X? LoadI RTL StoreI RTL MAR X MAR X JumpI and MBR M[MAR] MBR M[MAR] AddI use indirect addressing MAR MBR MAR MBR Their RTL MBR M[MAR] MBR AC are shown in the table below AC MBR M[MAR] MBR What are the differences between JumpI X and Jump X? AddI X and Add X? JumpI RTL AddI RTL MAR X MAR X MBR M[MAR] MBR M[MAR] PC MBR MAR MBR MBR M[MAR] AC AC + MBR 23

24 Exercise: 1. Write a program that calculates 2X + Y - Z where X, Y, Z are three different numbers in three different memory locations. Store the result in the main memory and display it. 2. Implement your code in MARIE simulator. 3. Check if you have errors. 4. Correct your errors and run your program. Makeup Final Question a) moves data within the computer. The faster the bus the better. This one runs at 400MHz. A system bus b) consists of an arithmetic-logic unit and storage units (registers) that are interconnected by a data bus that is also connected to main memory. The datapath c) The bit pattern for a LOAD 3 instruction as it would appear in the IR d) is the brain of the system. It executes program instructions. This one is a Pentium (Intel) running at 4.20GHz. The microprocessor e) The instruction number (Binary, Hexa) and the meaning separated by a space for skipcon instruction is skip next instruction on condition Makeup Final Question: Write down the RTL for the ADD instruction given value X MAR <- X MBR <-[MAR] AC <- AC + MBR Final Question: Write the MARIE Register Transfer Language for ADDI instruction. MAR X (1 Mark) MBR M[MAR] (1 Mark) MAR MBR (2 Mark) MBR M[MAR] (2 Mark) AC AC + MBR (1. 5 Ma Final Question: Write down the RTL for the ADD instruction given value X MAR <- X MBR <-[MAR] AC <- AC + MBR Final Question: Memory Organization and Addressing 24 (16 Marks) A. A computer systemuses a 128K x 16 main memory. How many bits do we need to address one memory location if: a) the memory is word addressable? (3 Marks) Each memory location contains 16 bits, so the memory contains: 128x2 10 x16/16 = 2 7 x 2 10 locations = 2 17 memory locations. 17 bits are needed to address one memory location. b) the memory is byte addressable? (3 Marks) Each memory location contains 8 bits, so the memory contains: 128x2 10 x16/9 = 2 7 x 2 10 x 2 locations = 2 18 memory locations. 18 bits are needed to address one memory location. Makeup Final Question: Consider the following assembly program ORG 100 Load One Store X Loop, Load X Subt Ten

25 SkipCond 000 Jump Endloop Load Sum Add X Store Sum Load X Add One Store X Jump Loop Endloop, Load Sum Output Halt Sum, Dec 0 X, Dec 0 One, Dec 1 Ten, Dec 10 END a) Present the register transfer notation (RTN) for each of the following instructions: - Load X - Store X - Add X - Subt X Sol. Load x MAR X {transfer address x to MAR} MBR M[MAR] {transfer data of address in MAR to MBR} AC MBR {transfer data in MBR to AC} - Store X MAR X {transfer address x to MAR} MBR AC {transfer data in AC to MBR } M[MAR] MBR {transfer data in MBR to address in MAR } - Add X MAR X {transfer address x to MAR} MBR M[MAR] {transfer data of address in MAR to MBR} AC AC + MBR { add the contents of MBR to the contents of AC} - Subt X MAR X {transfer address x to MAR} MBR M[MAR] {transfer data of address in MAR to MBR} AC AC - MBR { subtract data in MBR from AC} B) Describe the output of the above program. Answer: The output will be 45 which is the sum of 1 to 9 (loop) Some explanation is needed. especially the work of the loop C) Draw the connection of MARIE s Load instruction. Load has a binary number 0001 from table 4. P193 The signal patterns for the load instruction: P 0 P 1 P 2 P 3 T 0 : MAR X P 3 P 4 T 1 : MBR M[MAR] P 0 P 1 P 5 A 0 T 2 : AC MBR C r T 3 : [Reset counter] 25

26 Now, from the signal patterns we can draw the combinational logic circuit: Final Quesstion: Draw the timing Diagram for the Micro operations of MARE S Add instruction [ 8] 26

CHAPTER 4 MARIE: An Introduction to a Simple Computer

CHAPTER 4 MARIE: An Introduction to a Simple Computer CHAPTER 4 MARIE: An Introduction to a Simple Computer 4.1 Introduction 195 4.2 CPU Basics and Organization 195 4.2.1 The Registers 196 4.2.2 The ALU 197 4.2.3 The Control Unit 197 4.3 The Bus 197 4.4 Clocks

More information

Summary of the MARIE Assembly Language

Summary of the MARIE Assembly Language Supplement for Assignment # (sections.8 -. of the textbook) Summary of the MARIE Assembly Language Type of Instructions Arithmetic Data Transfer I/O Branch Subroutine call and return Mnemonic ADD X SUBT

More information

Central Processing Unit (CPU)

Central Processing Unit (CPU) Central Processing Unit (CPU) CPU is the heart and brain It interprets and executes machine level instructions Controls data transfer from/to Main Memory (MM) and CPU Detects any errors In the following

More information

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2 Lecture Handout Computer Architecture Lecture No. 2 Reading Material Vincent P. Heuring&Harry F. Jordan Chapter 2,Chapter3 Computer Systems Design and Architecture 2.1, 2.2, 3.2 Summary 1) A taxonomy of

More information

MICROPROCESSOR AND MICROCOMPUTER BASICS

MICROPROCESSOR AND MICROCOMPUTER BASICS Introduction MICROPROCESSOR AND MICROCOMPUTER BASICS At present there are many types and sizes of computers available. These computers are designed and constructed based on digital and Integrated Circuit

More information

(Refer Slide Time: 00:01:16 min)

(Refer Slide Time: 00:01:16 min) Digital Computer Organization Prof. P. K. Biswas Department of Electronic & Electrical Communication Engineering Indian Institute of Technology, Kharagpur Lecture No. # 04 CPU Design: Tirning & Control

More information

CHAPTER 7: The CPU and Memory

CHAPTER 7: The CPU and Memory CHAPTER 7: The CPU and Memory The Architecture of Computer Hardware, Systems Software & Networking: An Information Technology Approach 4th Edition, Irv Englander John Wiley and Sons 2010 PowerPoint slides

More information

150127-Microprocessor & Assembly Language

150127-Microprocessor & Assembly Language Chapter 3 Z80 Microprocessor Architecture The Z 80 is one of the most talented 8 bit microprocessors, and many microprocessor-based systems are designed around the Z80. The Z80 microprocessor needs an

More information

MACHINE ARCHITECTURE & LANGUAGE

MACHINE ARCHITECTURE & LANGUAGE in the name of God the compassionate, the merciful notes on MACHINE ARCHITECTURE & LANGUAGE compiled by Jumong Chap. 9 Microprocessor Fundamentals A system designer should consider a microprocessor-based

More information

Chapter 2 Logic Gates and Introduction to Computer Architecture

Chapter 2 Logic Gates and Introduction to Computer Architecture Chapter 2 Logic Gates and Introduction to Computer Architecture 2.1 Introduction The basic components of an Integrated Circuit (IC) is logic gates which made of transistors, in digital system there are

More information

Central Processing Unit

Central Processing Unit Chapter 4 Central Processing Unit 1. CPU organization and operation flowchart 1.1. General concepts The primary function of the Central Processing Unit is to execute sequences of instructions representing

More information

Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University cwliu@twins.ee.nctu.edu.

Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University cwliu@twins.ee.nctu.edu. Computer Architecture Lecture 2: Instruction Set Principles (Appendix A) Chih Wei Liu 劉 志 尉 National Chiao Tung University cwliu@twins.ee.nctu.edu.tw Review Computers in mid 50 s Hardware was expensive

More information

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Chapter 2 Basic Structure of Computers Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan Outline Functional Units Basic Operational Concepts Bus Structures Software

More information

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1

MICROPROCESSOR. Exclusive for IACE Students www.iace.co.in iacehyd.blogspot.in Ph: 9700077455/422 Page 1 MICROPROCESSOR A microprocessor incorporates the functions of a computer s central processing unit (CPU) on a single Integrated (IC), or at most a few integrated circuit. It is a multipurpose, programmable

More information

1 Classical Universal Computer 3

1 Classical Universal Computer 3 Chapter 6: Machine Language and Assembler Christian Jacob 1 Classical Universal Computer 3 1.1 Von Neumann Architecture 3 1.2 CPU and RAM 5 1.3 Arithmetic Logical Unit (ALU) 6 1.4 Arithmetic Logical Unit

More information

CPU Organisation and Operation

CPU Organisation and Operation CPU Organisation and Operation The Fetch-Execute Cycle The operation of the CPU 1 is usually described in terms of the Fetch-Execute cycle. 2 Fetch-Execute Cycle Fetch the Instruction Increment the Program

More information

CPU Organization and Assembly Language

CPU Organization and Assembly Language COS 140 Foundations of Computer Science School of Computing and Information Science University of Maine October 2, 2015 Outline 1 2 3 4 5 6 7 8 Homework and announcements Reading: Chapter 12 Homework:

More information

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory. 1 Topics Machine Architecture and Number Systems Major Computer Components Bits, Bytes, and Words The Decimal Number System The Binary Number System Converting from Decimal to Binary Major Computer Components

More information

Chapter 5 Instructor's Manual

Chapter 5 Instructor's Manual The Essentials of Computer Organization and Architecture Linda Null and Julia Lobur Jones and Bartlett Publishers, 2003 Chapter 5 Instructor's Manual Chapter Objectives Chapter 5, A Closer Look at Instruction

More information

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level System: User s View System Components: High Level View Input Output 1 System: Motherboard Level 2 Components: Interconnection I/O MEMORY 3 4 Organization Registers ALU CU 5 6 1 Input/Output I/O MEMORY

More information

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions CS101 Lecture 26: Low Level Programming John Magee 30 July 2013 Some material copyright Jones and Bartlett 1 Overview/Questions What did we do last time? How can we control the computer s circuits? How

More information

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored? Inside the CPU how does the CPU work? what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored? some short, boring programs to illustrate the

More information

Chapter 1 Computer System Overview

Chapter 1 Computer System Overview Operating Systems: Internals and Design Principles Chapter 1 Computer System Overview Eighth Edition By William Stallings Operating System Exploits the hardware resources of one or more processors Provides

More information

LSN 2 Computer Processors

LSN 2 Computer Processors LSN 2 Computer Processors Department of Engineering Technology LSN 2 Computer Processors Microprocessors Design Instruction set Processor organization Processor performance Bandwidth Clock speed LSN 2

More information

Let s put together a Manual Processor

Let s put together a Manual Processor Lecture 14 Let s put together a Manual Processor Hardware Lecture 14 Slide 1 The processor Inside every computer there is at least one processor which can take an instruction, some operands and produce

More information

PART B QUESTIONS AND ANSWERS UNIT I

PART B QUESTIONS AND ANSWERS UNIT I PART B QUESTIONS AND ANSWERS UNIT I 1. Explain the architecture of 8085 microprocessor? Logic pin out of 8085 microprocessor Address bus: unidirectional bus, used as high order bus Data bus: bi-directional

More information

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995 UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering EEC180B Lab 7: MISP Processor Design Spring 1995 Objective: In this lab, you will complete the design of the MISP processor,

More information

İSTANBUL AYDIN UNIVERSITY

İSTANBUL AYDIN UNIVERSITY İSTANBUL AYDIN UNIVERSITY FACULTY OF ENGİNEERİNG SOFTWARE ENGINEERING THE PROJECT OF THE INSTRUCTION SET COMPUTER ORGANIZATION GÖZDE ARAS B1205.090015 Instructor: Prof. Dr. HASAN HÜSEYİN BALIK DECEMBER

More information

Chapter 6. Inside the System Unit. What You Will Learn... Computers Are Your Future. What You Will Learn... Describing Hardware Performance

Chapter 6. Inside the System Unit. What You Will Learn... Computers Are Your Future. What You Will Learn... Describing Hardware Performance What You Will Learn... Computers Are Your Future Chapter 6 Understand how computers represent data Understand the measurements used to describe data transfer rates and data storage capacity List the components

More information

Programming Logic controllers

Programming Logic controllers Programming Logic controllers Programmable Logic Controller (PLC) is a microprocessor based system that uses programmable memory to store instructions and implement functions such as logic, sequencing,

More information

Computer Organization. and Instruction Execution. August 22

Computer Organization. and Instruction Execution. August 22 Computer Organization and Instruction Execution August 22 CSC201 Section 002 Fall, 2000 The Main Parts of a Computer CSC201 Section Copyright 2000, Douglas Reeves 2 I/O and Storage Devices (lots of devices,

More information

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language Chapter 4 Register Transfer and Microoperations Section 4.1 Register Transfer Language Digital systems are composed of modules that are constructed from digital components, such as registers, decoders,

More information

Memory Systems. Static Random Access Memory (SRAM) Cell

Memory Systems. Static Random Access Memory (SRAM) Cell Memory Systems This chapter begins the discussion of memory systems from the implementation of a single bit. The architecture of memory chips is then constructed using arrays of bit implementations coupled

More information

Administrative Issues

Administrative Issues CSC 3210 Computer Organization and Programming Introduction and Overview Dr. Anu Bourgeois (modified by Yuan Long) Administrative Issues Required Prerequisites CSc 2010 Intro to CSc CSc 2310 Java Programming

More information

Notes on Assembly Language

Notes on Assembly Language Notes on Assembly Language Brief introduction to assembly programming The main components of a computer that take part in the execution of a program written in assembly code are the following: A set of

More information

TIMING DIAGRAM O 8085

TIMING DIAGRAM O 8085 5 TIMING DIAGRAM O 8085 5.1 INTRODUCTION Timing diagram is the display of initiation of read/write and transfer of data operations under the control of 3-status signals IO / M, S 1, and S 0. As the heartbeat

More information

8051 MICROCONTROLLER COURSE

8051 MICROCONTROLLER COURSE 8051 MICROCONTROLLER COURSE Objective: 1. Familiarization with different types of Microcontroller 2. To know 8051 microcontroller in detail 3. Programming and Interfacing 8051 microcontroller Prerequisites:

More information

MACHINE INSTRUCTIONS AND PROGRAMS

MACHINE INSTRUCTIONS AND PROGRAMS CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS CHAPTER OBJECTIVES In this chapter you will learn about: Machine instructions and program execution, including branching and subroutine call and return operations

More information

CSCI 4717 Computer Architecture. Function. Data Storage. Data Processing. Data movement to a peripheral. Data Movement

CSCI 4717 Computer Architecture. Function. Data Storage. Data Processing. Data movement to a peripheral. Data Movement CSCI 4717/5717 Computer Architecture Topic: Functional View & History Reading: Sections 1.2, 2.1, & 2.3 Function All computer functions are comprised of four basic operations: Data processing Data storage

More information

Computer organization

Computer organization Computer organization Computer design an application of digital logic design procedures Computer = processing unit + memory system Processing unit = control + datapath Control = finite state machine inputs

More information

MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS

MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS 1) Which is the microprocessor comprises: a. Register section b. One or more ALU c. Control unit 2) What is the store by register? a. data b. operands

More information

The Central Processing Unit:

The Central Processing Unit: The Central Processing Unit: What Goes on Inside the Computer Chapter 4 Objectives Identify the components of the central processing unit and how they work together and interact with memory Describe how

More information

CSE 141L Computer Architecture Lab Fall 2003. Lecture 2

CSE 141L Computer Architecture Lab Fall 2003. Lecture 2 CSE 141L Computer Architecture Lab Fall 2003 Lecture 2 Pramod V. Argade CSE141L: Computer Architecture Lab Instructor: TA: Readers: Pramod V. Argade (p2argade@cs.ucsd.edu) Office Hour: Tue./Thu. 9:30-10:30

More information

TEACHING COMPUTER ARCHITECTURE THROUGH SIMULATION (A BRIEF EVALUATION OF CPU SIMULATORS) *

TEACHING COMPUTER ARCHITECTURE THROUGH SIMULATION (A BRIEF EVALUATION OF CPU SIMULATORS) * TEACHING COMPUTER ARCHITECTURE THROUGH SIMULATION (A BRIEF EVALUATION OF CPU SIMULATORS) * Timothy Stanley, PhD Computer and Network Sciences, Utah Valley University, Orem, Utah 84058, 801 863-8978, TStanley@uvu.edu

More information

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12 C5 Solutions 1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12 To Compute 0 0 = 00000000 To Compute 1 Step 1. Convert 1 to binary 00000001 Step 2. Flip the bits 11111110

More information

Counters and Decoders

Counters and Decoders Physics 3330 Experiment #10 Fall 1999 Purpose Counters and Decoders In this experiment, you will design and construct a 4-bit ripple-through decade counter with a decimal read-out display. Such a counter

More information

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer Computers CMPT 125: Lecture 1: Understanding the Computer Tamara Smyth, tamaras@cs.sfu.ca School of Computing Science, Simon Fraser University January 3, 2009 A computer performs 2 basic functions: 1.

More information

2011, The McGraw-Hill Companies, Inc. Chapter 3

2011, The McGraw-Hill Companies, Inc. Chapter 3 Chapter 3 3.1 Decimal System The radix or base of a number system determines the total number of different symbols or digits used by that system. The decimal system has a base of 10 with the digits 0 through

More information

Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Systems I: Computer Organization and Architecture Lecture : Microprogrammed Control Microprogramming The control unit is responsible for initiating the sequence of microoperations that comprise instructions.

More information

The 104 Duke_ACC Machine

The 104 Duke_ACC Machine The 104 Duke_ACC Machine The goal of the next two lessons is to design and simulate a simple accumulator-based processor. The specifications for this processor and some of the QuartusII design components

More information

A s we saw in Chapter 4, a CPU contains three main sections: the register section,

A s we saw in Chapter 4, a CPU contains three main sections: the register section, 6 CPU Design A s we saw in Chapter 4, a CPU contains three main sections: the register section, the arithmetic/logic unit (ALU), and the control unit. These sections work together to perform the sequences

More information

ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER

ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER Pierre A. von Kaenel Mathematics and Computer Science Department Skidmore College Saratoga Springs, NY 12866 (518) 580-5292 pvonk@skidmore.edu ABSTRACT This paper

More information

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC6504 - Microprocessor & Microcontroller Year/Sem : II/IV UNIT I THE 8086 MICROPROCESSOR 1. What is the purpose of segment registers

More information

3.Basic Gate Combinations

3.Basic Gate Combinations 3.Basic Gate Combinations 3.1 TTL NAND Gate In logic circuits transistors play the role of switches. For those in the TTL gate the conducting state (on) occurs when the baseemmiter signal is high, and

More information

BASIC COMPUTER ORGANIZATION AND DESIGN

BASIC COMPUTER ORGANIZATION AND DESIGN 1 BASIC COMPUTER ORGANIZATION AND DESIGN Instruction Codes Computer Registers Computer Instructions Timing and Control Instruction Cycle Memory Reference Instructions Input-Output and Interrupt Complete

More information

Binary Adders: Half Adders and Full Adders

Binary Adders: Half Adders and Full Adders Binary Adders: Half Adders and Full Adders In this set of slides, we present the two basic types of adders: 1. Half adders, and 2. Full adders. Each type of adder functions to add two binary bits. In order

More information

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas Take-Home Exercise Assume you want the counter below to count mod-6 backward. That is, it would count 0-5-4-3-2-1-0, etc. Assume it is reset on startup, and design the wiring to make the counter count

More information

Instruction Set Architecture (ISA)

Instruction Set Architecture (ISA) Instruction Set Architecture (ISA) * Instruction set architecture of a machine fills the semantic gap between the user and the machine. * ISA serves as the starting point for the design of a new machine

More information

================================================================

================================================================ ==== ==== ================================================================ DR 6502 AER 201S Engineering Design 6502 Execution Simulator ================================================================

More information

Learning Outcomes. Simple CPU Operation and Buses. Composition of a CPU. A simple CPU design

Learning Outcomes. Simple CPU Operation and Buses. Composition of a CPU. A simple CPU design Learning Outcomes Simple CPU Operation and Buses Dr Eddie Edwards eddie.edwards@imperial.ac.uk At the end of this lecture you will Understand how a CPU might be put together Be able to name the basic components

More information

Traditional IBM Mainframe Operating Principles

Traditional IBM Mainframe Operating Principles C H A P T E R 1 7 Traditional IBM Mainframe Operating Principles WHEN YOU FINISH READING THIS CHAPTER YOU SHOULD BE ABLE TO: Distinguish between an absolute address and a relative address. Briefly explain

More information

Computer Performance. Topic 3. Contents. Prerequisite knowledge Before studying this topic you should be able to:

Computer Performance. Topic 3. Contents. Prerequisite knowledge Before studying this topic you should be able to: 55 Topic 3 Computer Performance Contents 3.1 Introduction...................................... 56 3.2 Measuring performance............................... 56 3.2.1 Clock Speed.................................

More information

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies ETEC 2301 Programmable Logic Devices Chapter 10 Counters Shawnee State University Department of Industrial and Engineering Technologies Copyright 2007 by Janna B. Gallaher Asynchronous Counter Operation

More information

CHAPTER 2: HARDWARE BASICS: INSIDE THE BOX

CHAPTER 2: HARDWARE BASICS: INSIDE THE BOX CHAPTER 2: HARDWARE BASICS: INSIDE THE BOX Multiple Choice: 1. Processing information involves: A. accepting information from the outside world. B. communication with another computer. C. performing arithmetic

More information

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s)

Addressing The problem. When & Where do we encounter Data? The concept of addressing data' in computations. The implications for our machine design(s) Addressing The problem Objectives:- When & Where do we encounter Data? The concept of addressing data' in computations The implications for our machine design(s) Introducing the stack-machine concept Slide

More information

An Overview of Stack Architecture and the PSC 1000 Microprocessor

An Overview of Stack Architecture and the PSC 1000 Microprocessor An Overview of Stack Architecture and the PSC 1000 Microprocessor Introduction A stack is an important data handling structure used in computing. Specifically, a stack is a dynamic set of elements in which

More information

An Introduction to Computer Science and Computer Organization Comp 150 Fall 2008

An Introduction to Computer Science and Computer Organization Comp 150 Fall 2008 An Introduction to Computer Science and Computer Organization Comp 150 Fall 2008 Computer Science the study of algorithms, including Their formal and mathematical properties Their hardware realizations

More information

ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6)

ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6) ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6) 1 COMPUTER LANGUAGES In order for a computer to be able to execute a program, the program must first be present

More information

A3 Computer Architecture

A3 Computer Architecture A3 Computer Architecture Engineering Science 3rd year A3 Lectures Prof David Murray david.murray@eng.ox.ac.uk www.robots.ox.ac.uk/ dwm/courses/3co Michaelmas 2000 1 / 1 6. Stacks, Subroutines, and Memory

More information

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit.

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit. Objectives The Central Processing Unit: What Goes on Inside the Computer Chapter 4 Identify the components of the central processing unit and how they work together and interact with memory Describe how

More information

1 Description of The Simpletron

1 Description of The Simpletron Simulating The Simpletron Computer 50 points 1 Description of The Simpletron In this assignment you will write a program to simulate a fictional computer that we will call the Simpletron. As its name implies

More information

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 OUTCOME 3 PART 1

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 OUTCOME 3 PART 1 UNIT 22: PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 OUTCOME 3 PART 1 This work covers part of outcome 3 of the Edexcel standard module: Outcome 3 is the most demanding

More information

We r e going to play Final (exam) Jeopardy! "Answers:" "Questions:" - 1 -

We r e going to play Final (exam) Jeopardy! Answers: Questions: - 1 - . (0 pts) We re going to play Final (exam) Jeopardy! Associate the following answers with the appropriate question. (You are given the "answers": Pick the "question" that goes best with each "answer".)

More information

Building a computer. Electronic Numerical Integrator and Computer (ENIAC)

Building a computer. Electronic Numerical Integrator and Computer (ENIAC) Building a computer Electronic Numerical Integrator and Computer (ENIAC) CSCI 255: Introduc/on to Embedded Systems Keith Vertanen Copyright 2011 Layers of abstrac

More information

PROBLEMS (Cap. 4 - Istruzioni macchina)

PROBLEMS (Cap. 4 - Istruzioni macchina) 98 CHAPTER 2 MACHINE INSTRUCTIONS AND PROGRAMS PROBLEMS (Cap. 4 - Istruzioni macchina) 2.1 Represent the decimal values 5, 2, 14, 10, 26, 19, 51, and 43, as signed, 7-bit numbers in the following binary

More information

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System? Management Challenge Managing Hardware Assets What computer processing and storage capability does our organization need to handle its information and business transactions? What arrangement of computers

More information

How It All Works. Other M68000 Updates. Basic Control Signals. Basic Control Signals

How It All Works. Other M68000 Updates. Basic Control Signals. Basic Control Signals CPU Architectures Motorola 68000 Several CPU architectures exist currently: Motorola Intel AMD (Advanced Micro Devices) PowerPC Pick one to study; others will be variations on this. Arbitrary pick: Motorola

More information

a storage location directly on the CPU, used for temporary storage of small amounts of data during processing.

a storage location directly on the CPU, used for temporary storage of small amounts of data during processing. CS143 Handout 18 Summer 2008 30 July, 2008 Processor Architectures Handout written by Maggie Johnson and revised by Julie Zelenski. Architecture Vocabulary Let s review a few relevant hardware definitions:

More information

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware A+ Guide to Managing and Maintaining Your PC, 7e Chapter 1 Introducing Hardware Objectives Learn that a computer requires both hardware and software to work Learn about the many different hardware components

More information

Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8

Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8 Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8 January 22, 2013 Name: Grade /10 Introduction: In this lab you will write, test, and execute a number of simple PDP-8

More information

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter Description: The NTE2053 is a CMOS 8 bit successive approximation Analog to Digital converter in a 20 Lead DIP type package which uses a differential

More information

LADDER LOGIC/ FLOWCHART PROGRAMMING DIFFERENCES AND EXAMPLES

LADDER LOGIC/ FLOWCHART PROGRAMMING DIFFERENCES AND EXAMPLES page 1/10 This document is designed as a quick-start primer to assist industrial automation programmers who are familiar with PLCs and Relay Ladder Logic programming to better understand the corresponding

More information

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1 UNIT 22: PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1 This work covers part of outcome 2 of the Edexcel standard module. The material is

More information

CSE2102 Digital Design II - Topics CSE2102 - Digital Design II

CSE2102 Digital Design II - Topics CSE2102 - Digital Design II CSE2102 Digital Design II - Topics CSE2102 - Digital Design II 6 - Microprocessor Interfacing - Memory and Peripheral Dr. Tim Ferguson, Monash University. AUSTRALIA. Tel: +61-3-99053227 FAX: +61-3-99053574

More information

OVERVIEW OF MICROPROCESSORS

OVERVIEW OF MICROPROCESSORS C HAPTER 1 OVERVIEW OF MICROPROCESSORS 1.1 GENERAL A microprocessor is one of the most exciting technological innovations in electronics since the appearance of the transistor in 1948. This wonder device

More information

Computer Systems Structure Input/Output

Computer Systems Structure Input/Output Computer Systems Structure Input/Output Peripherals Computer Central Processing Unit Main Memory Computer Systems Interconnection Communication lines Input Output Ward 1 Ward 2 Examples of I/O Devices

More information

Unit A451: Computer systems and programming. Section 2: Computing Hardware 1/5: Central Processing Unit

Unit A451: Computer systems and programming. Section 2: Computing Hardware 1/5: Central Processing Unit Unit A451: Computer systems and programming Section 2: Computing Hardware 1/5: Central Processing Unit Section Objectives Candidates should be able to: (a) State the purpose of the CPU (b) Understand the

More information

Here is a diagram of a simple computer system: (this diagram will be the one needed for exams) CPU. cache

Here is a diagram of a simple computer system: (this diagram will be the one needed for exams) CPU. cache Computer Systems Here is a diagram of a simple computer system: (this diagram will be the one needed for exams) CPU cache bus memory controller keyboard controller display controller disk Computer Systems

More information

Central Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis

Central Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis Central Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis 1 1 Table of Contents 1 Table of Contents... 3 2 Overview... 5 3 Installation... 7 4 The CPU

More information

EMBEDDED SYSTEM BASICS AND APPLICATION

EMBEDDED SYSTEM BASICS AND APPLICATION EMBEDDED SYSTEM BASICS AND APPLICATION TOPICS TO BE DISCUSSED System Embedded System Components Classifications Processors Other Hardware Software Applications 2 INTRODUCTION What is a system? A system

More information

Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek

Instruction Set Architecture. or How to talk to computers if you aren t in Star Trek Instruction Set Architecture or How to talk to computers if you aren t in Star Trek The Instruction Set Architecture Application Compiler Instr. Set Proc. Operating System I/O system Instruction Set Architecture

More information

TYPES OF COMPUTERS AND THEIR PARTS MULTIPLE CHOICE QUESTIONS

TYPES OF COMPUTERS AND THEIR PARTS MULTIPLE CHOICE QUESTIONS MULTIPLE CHOICE QUESTIONS 1. What is a computer? a. A programmable electronic device that processes data via instructions to output information for future use. b. Raw facts and figures that has no meaning

More information

Figure 1: Graphical example of a mergesort 1.

Figure 1: Graphical example of a mergesort 1. CSE 30321 Computer Architecture I Fall 2011 Lab 02: Procedure Calls in MIPS Assembly Programming and Performance Total Points: 100 points due to its complexity, this lab will weight more heavily in your

More information

EC 362 Problem Set #2

EC 362 Problem Set #2 EC 362 Problem Set #2 1) Using Single Precision IEEE 754, what is FF28 0000? 2) Suppose the fraction enhanced of a processor is 40% and the speedup of the enhancement was tenfold. What is the overall speedup?

More information

GETTING STARTED WITH PROGRAMMABLE LOGIC DEVICES, THE 16V8 AND 20V8

GETTING STARTED WITH PROGRAMMABLE LOGIC DEVICES, THE 16V8 AND 20V8 GETTING STARTED WITH PROGRAMMABLE LOGIC DEVICES, THE 16V8 AND 20V8 Robert G. Brown All Rights Reserved August 25, 2000 Alta Engineering 58 Cedar Lane New Hartford, CT 06057-2905 (860) 489-8003 www.alta-engineering.com

More information

CHAPTER 6: Computer System Organisation 1. The Computer System's Primary Functions

CHAPTER 6: Computer System Organisation 1. The Computer System's Primary Functions CHAPTER 6: Computer System Organisation 1. The Computer System's Primary Functions All computers, from the first room-sized mainframes, to today's powerful desktop, laptop and even hand-held PCs, perform

More information

Introducción. Diseño de sistemas digitales.1

Introducción. Diseño de sistemas digitales.1 Introducción Adapted from: Mary Jane Irwin ( www.cse.psu.edu/~mji ) www.cse.psu.edu/~cg431 [Original from Computer Organization and Design, Patterson & Hennessy, 2005, UCB] Diseño de sistemas digitales.1

More information

Binary Numbers. Binary Octal Hexadecimal

Binary Numbers. Binary Octal Hexadecimal Binary Numbers Binary Octal Hexadecimal Binary Numbers COUNTING SYSTEMS UNLIMITED... Since you have been using the 10 different digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9 all your life, you may wonder how

More information

Lecture 2. Binary and Hexadecimal Numbers

Lecture 2. Binary and Hexadecimal Numbers Lecture 2 Binary and Hexadecimal Numbers Purpose: Review binary and hexadecimal number representations Convert directly from one base to another base Review addition and subtraction in binary representations

More information

Basic Computer Organization

Basic Computer Organization Chapter 2 Basic Computer Organization Objectives To provide a high-level view of computer organization To describe processor organization details To discuss memory organization and structure To introduce

More information