Computer Organization And Architecture Alanclements-PDF Download

  • Date:01 Jan 2020
  • Views:50
  • Downloads:0
  • Pages:84
  • Size:4.35 MB

Share Pdf : Computer Organization And Architecture Alanclements

Download and Preview : Computer Organization And Architecture Alanclements

Report CopyRight/DMCA Form For : Computer Organization And Architecture Alanclements


Version 1 WORKBOOK FOR COMPUTER ORGANIZATION AND ARCHITECTURE THEME AND VARIATIONS. INTRODUCTION, This workbook has been written to accompany Computer Organization and Architecture Themes and Variations and is. designed to give students a practical introduction to the ARM processor simulator from Kiel I have provided examples of the. use of the ARM family simulator plus notes and comments in order to allow students to work together in labs and tutorials or. for individual study at home, Before we introduce the simulator we look at several background topics that are needed before you can begin to write. assembly language level programs,THE INSTRUCTION SET ARCHITECTURE. An instruction set architecture or ISA is an abstract model of a computer that describes what it does rather than how it does. it You could say that a computer s instruction set architecture is its functional definition Essentially the ISA is concerned. with a computer s internal storage its registers the operations that the computer can perform on data the instruction set and. the addressing modes used to access data The term addressing mode is just a fancy way of expressing where the data is for. example you can say that the data is in location 100 or you can say that it s 200 location from here or you can say here s the. actual data itself, The first part of Computer Organization and Architecture Themes and Variations is concerned with the instruction set. architecture and the second part is concerned with computer organization which described an ISA is actually implemented. Today the term microarchitecture has largely replaced the computer organization In this workbook we are interested in the. ISA rather than the microarchitecture, A register is a storage device that holds a single data word exactly like a memory location Registers are physically located on.
the CPU chip and can be accessed far more rapidly than memory You can think of a register as a place in which data is waiting. to be processed When computers operate on data they frequently operate on data that is in a register For example to perform. the multiplication A B C you first read the values of B and C from memory into two registers Then you multiply the two. numbers in the registers and put the result in a register Finally the result is transferred from a register to location A in memory. In principle there s no fundamental difference between a location in memory and a register There are just a few registers in a. computer but millions of storage locations in memory Consequently you need far fewer bits to specify a register than a. memory location For example if a computer has eight data registers an instruction requires only three bits to select one of the. eight registers to be used by an operation that is from 000 to 111 If you specify a memory location you need 32 bits to select. one out of 232 possible locations assuming a 32 bit address space. The size of a register its width in bits is normally the same size as memory locations and the size of the arithmetic and logical. operations in the CPU If you have a computer with 32 bit words they are held in 32 bit memory locations and 32 bit registers. and are processed by 32 bit adders and so on, There is no fundamental difference between a register and a memory location If you could store gigabytes of high speed. memory on a CPU chip and you could use very long instruction words i e with the long addresses needed to specify one. individual location then there would be no point in using registers If you had a computer with 4 Gbytes of memory 232 bytes. and wished to have an instruction that could implement C A B i e ADD C A B the you would require typically 16 32. 32 32 112 bits the 16 bits represent the number of bits to encode the actual operation and the three 32 bits are needed for. the addresses A B and C No mainstream modern computer has such a long instruction word. V 5 0 2014 Cengage Learning All Rights Reserved May not be scanned copied or duplicated or posted to a publicly accessible website in whole or in part 1 P a g e. Version 1 WORKBOOK FOR COMPUTER ORGANIZATION AND ARCHITECTURE THEME AND VARIATIONS. PROBLEM SET 1, 1 In your own words explain what a register is in a computer. 2 How many registers does the 68K have,3 How many registers does the ARM have. 4 What s the processor with the largest number of registers that you can find. 5 If a computer has 128 user accessible general purpose registers how many bits are be required to access a register. That is how many bits does it take to specify 1 out of 128. 6 Suppose a computer has eight registers and a 24 bit instruction length A data processing instruction is of the. ADD r1 r2 r3 which implements r1 r2 r3 How many bits in an instruction can be allocated to specifying an. operation if there are four general purpose registers. IMPORTANT POINT, Never confuse the following two concepts value and address or location A memory location holds. a value which is the information stored in that location The address of an item is where it is in. memory and its value is what it is, For example suppose memory location 1234 contains the value 55 If we add 1 to 55 we get 55 1.
which is 56 That is we ve changed the value of a variable Now if we add 1 to the address 1234 we. get 1235 That s a different location in memory which holds a different variable. The reason for making this point is that it is all too easy to confuse these two concepts because of the. way we learn algebra at high school We use equations like x 4 When we write programs that use. variables the variables usually refer to the locations of data not to the values So when we say x 4. we actually mean that the memory location called x contains the value 4. PROBLEM SET 2, The following problems are intended to help you understand the history of the computer These problems are intended as. discussion points and don t have simple right or wrong answers In order to do these questions you will need to read the Web. based history material that accompanies this text You will also need to use the web as a research tool. 1 When did the idea of a computer first occur to people. 2 What is a computer, 3 One of the names most associated with the history of computing is John von Neumann Who was von Neumann Did. he invent the computer, 4 When was the first microprocessor created and by whom. 5 What was the form of the first memory used by computers or computing devices This warning symbol will appear. 6 Who said and when There is a world market for maybe five computers whenever a particularly. important or tricky concept is, 7 What was the first hobby computer personal computer and when was it built introduced. 8 Who was Konrad Zuse, V 5 0 2014 Cengage Learning All Rights Reserved May not be scanned copied or duplicated or posted to a publicly accessible website in whole or in part 2 P a g e.
Version 1 WORKBOOK FOR COMPUTER ORGANIZATION AND ARCHITECTURE THEME AND VARIATIONS. ADDRESSING MODES, An addressing mode is simply a means of expressing the location of an operand An address can be a register such as r3 or. D7 or PC program counter An address can be a location in memory such as address 0x12345678 You can even express an. address indirectly by saying for example the address is the location whose address is in register r1 All the various ways of. expressing the location of data are called collectively addressing modes. Suppose someone said Here s ten dollars They are giving you the actual item This is called a literal or immediate value. because it s what you actually get Unlike all other addressing modes you don t have to retrieve immediate data from a register. or memory location, If someone says Go to room 30 and you ll find the money on the table they are telling you where the money is i e its. address is room 30 This is called an absolute address because expresses absolutely exactly where the money is This. addressing modes is also called direct addressing, Now here s where the fun starts Suppose someone says Go to room 40 and you ll find something to your advantage on the. table You arrive at room 40 and see a message on the table saying The money is in room 60 In this case we have an. indirect address because room 40 doesn t give us with the money but a pointer to where it is We have to go to a second room. to get the money Indirect addressing is also called pointer based addressing because you can think of the note in room 40 as. pointing to the actual data, In real life we can t confuse a room or address in with a sum of money However in a computer all data is stored in binary. form and the programmer has to remember whether a variable or constant is an address or a data value. By the way because there is no means of telling which operand is a source and which is a destination in a computer instruction. such as MOVE A B and different computers use different conventions I have decided to write the destination operand in bold. font to make it easier to understand the code For example MOVE A B means that B is moved to A because A is bold and. therefore the destination of the result, Let s look at three computer instructions in 68K assembly language The operation MOVE D0 D1 means.
copy the contents of register D0 into D1 The operation MOVE A0 D1 means copy the contents of the. memory location pointed at by register A0 into register D1 This is an example of indirect addressing. because the instruction specifies register A0 as the source operand and then this value has to be read in. order to access the desired operand in memory, Here we ve used 68K instructions the 68K instruction set is given as an appendix on page 8 In ARM. assembly language which is the subject of this Workbook indirect addressing is indicated by square brackets For example. LDR r0 r1 indicates that the contents of the memory location pointed at by register r1 is to be read and copied into. register r0 Note that the ARM and 68K assembly languages specify the order of operands differently In the assembly. language we use in this course, Immediate literal addressing is indicated by a symbol in front of the operand this convention is used by both the ARM. and 68K Thus 5 in an instruction means the actual value 5 A typical ARM instruction is MOV r0 5 which means move. the value 5 into register r0, Absolute direct addressing is not implemented by the ARM processor It is provided by the 68K and Intel IA32 processors. for example the 68K instruction MOVE 1234 D0 means load register D0 with the contents of memory location 1234 The. ARM supports only register indirect addressing, Indirect addressing is indicated by ARM processors by placing the pointer in square parentheses for example r1 All ARM. indirect addresses are of the basic form LDR r0 r1 or STR r3 r6 There are variations on this addressing mode. for example LDR r0 r1 4 specifies an address that is four bytes on from the location pointed at by the contents of. register r1, V 5 0 2014 Cengage Learning All Rights Reserved May not be scanned copied or duplicated or posted to a publicly accessible website in whole or in part 3 P a g e.
Version 1 WORKBOOK FOR COMPUTER ORGANIZATION AND ARCHITECTURE THEME AND VARIATIONS. ADDRESSING MODES EXAMPLE, Let s clarify addressing modes with a simple example The memory map below gives the contents of each of the locations of a. simple 16 word memory Each of these locations contains a 4 bit binary value We are going to look at some examples of the. effect of computer operations We adopt ARM style assembly instructions and assume 4 bit addresses and 4 bit data. Assume that r1 initially contains 0001 and r2 contains 1000. a MOV r0 1100 Literal address Register r0 is loaded with 1100. b LDR r0 r1 Register indirect address Register r0 is loaded with 0011. c LDR r0 r2 Register indirect address Register r0 is loaded with 1010. d LDR r0 r1 r2 Register indirect address sum of r1 and r2 Register r0 is loaded with 1111. e LDR r0 r2 4 Register indirect address r2 4 Register r0 is loaded with 0001. f LDR r0 r2 4 Register indirect address r2 4 Register r0 is loaded with 0000. As you can see the processor uses the address in r1 or r2 to access the appropriate memory location ARM processors like. other processors are able to perform limited pointer arithmetic For example in d the effective address is given as r1 r2. which is the location pointed at by the sum of these two registers The sum of r1 and r2 is 0001 1000 1001 so the contents. of location 1001 i e 1111 are loaded into r0, Example e calculates an effective address by adding 4 to the contents of r2 to get 1000 0100 1100 The contents of. memory location 1100 is 0001 and that value is loaded into r0 Note that example f is almost the same except that the. constant is negative In this case the contents of location 1000 0100 0100 i e 0000 are loaded into r0 A negative offset. like this accesses a location at a lower address, V 5 0 2014 Cengage Learning All Rights Reserved May not be scanned copied or duplicated or posted to a publicly accessible website in whole or in part 4 P a g e. Version 1 WORKBOOK FOR COMPUTER ORGANIZATION AND ARCHITECTURE THEME AND VARIATIONS. A special purpose computer has an instruction with a word length of 24 bits It is intended to. perform operation of the type ADD r3 24 where ADD is an operation 24 is a literal an actual. number and r3 is a destination register, If there are 200 different instructions and 32 registers what is the range of unsigned integer. COMPUTER ORGANIZATION AND ARCHITECTURE Themes and Variations ARM Processor WORKBOOK Alan Clements

Related Books