SFU - CMPT 150 - Lectures - Week 10

SFU - CMPT 150 - Lectures - Week 10 - c A.H.Dixon CMPT 150...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: c A.H.Dixon CMPT 150: Week 10 (Mar 10 - 14, 2008) 83 30 PROGRAMMING PROCESSORS While the processor described previously is capable of performing any of the func- tions defined by the ALU and, in particular, the eight functions defined in the previous table, it is capable of performing other functions not defined by the table as well. For example, consider the task of subtracting the values stored in two locations in memory and then saving the result. Suppose that the values to be subtracted are in locations 12 and 13 of memory, and that the result is to be stored in location 14. There is no ALU function to subtract, and clearly the problem descriptions suggests a sequence of tasks: get the values from memory into registers A and B; subtract them; store the result in memory. However, as was described previously, subtraction is possible by performing a sequence of ALU functions: increment A; complement B; add A and B. Definition : A machine language program is a sequence of control input assign- ments to a processor that, when performed in the order given, performs a more complex task. In this case the program needed to address the problem described consists of a sequence of control input assignments that perform the following register transfer statements. Beside each is the appropriate opcode that specifies the needed con- trol input assignments and an address defining a location in memory. Note that each statement corresponds to one assignment of values to the control inputs as determined by the eight rows of the function table given previously: step statement opcode address (ad) 1 A <- M[12] 000 1100 2 B <- M[13] 001 1101 3 A <- A plus 1 110 4 B <- B 101 5 A <- A plus B 100 6 M[14] <- A 010 1110 So if the contents of M[12] = 2 and the contents of M[13] = 3, then by assigning to the input ports opcode and ad of the processor, the values given in the table in the order indicated, the effect would be to perform the steps given, leaving the value -1 in M[14]. The binary sequence defined by the opcode and ad is called a machine language instruction , and the sequence of machine instructions given in the table above is the machine language program. c A.H.Dixon CMPT 150: Week 10 (Mar 10 - 14, 2008) 84 31 STORED PROGRAMS Rather that physically entering each machine language instruction of a program individually in the order needed, they can be stored in a memory because they are binary sequences. The execution of the machine language program then consists of retrieving the instructions, one at a time, from the memory and applying them to the opcode and ad ports as was previously done manually. When a program and the data that it will access are stored in the same memory unit, the processor organization is called a “von Neumann Computer Model”. This model is the one used in over 90% of computers today....
View Full Document

This note was uploaded on 06/20/2010 for the course CMPT 150 taught by Professor Dr.anthonydixon during the Spring '08 term at Simon Fraser.

Page1 / 11

SFU - CMPT 150 - Lectures - Week 10 - c A.H.Dixon CMPT 150...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online