Presentation is loading. Please wait.

Presentation is loading. Please wait.

University of Texas Pan AmDr. John P. Abraham Information Technology Computer Architecture Dr. John P. Abraham.

Similar presentations


Presentation on theme: "University of Texas Pan AmDr. John P. Abraham Information Technology Computer Architecture Dr. John P. Abraham."— Presentation transcript:

1 University of Texas Pan AmDr. John P. Abraham Information Technology Computer Architecture Dr. John P. Abraham

2 University of Texas Pan AmDr. John P. Abraham Computer Architecture The computer architecture is a branch of study that deals with designing of processors their instruction sets organizing various components to facilitate most efficient communication between them without significantly increasing cost.

3 University of Texas Pan AmDr. John P. Abraham Digital Computers Analog Digital –Distinct binary signals Instruction set –Predetermined by circuitry

4 University of Texas Pan AmDr. John P. Abraham CISC/RISC CISC –More instructions in the instruction set Easier for programmers More complex and slower machines RISC –Simpler instructions –Fewer instructions

5 University of Texas Pan AmDr. John P. Abraham A computer Input/output Processor –ALU –Control Unit –Registers –Connecting busses

6 University of Texas Pan AmDr. John P. Abraham Basic Operation of a CPU Obtain instructions kept in the memory, one at a time Decode Execute Write the result back

7 University of Texas Pan AmDr. John P. Abraham Binary number system Calculate value of 11110101 in decimal Number from right to left Digit value Value 1 11 x 1 = 1 0 20 x 2 = 0 1 41 x 4 = 4 0 80 x 8 = 0 1 161 x 16 = 16 1 321 x 32 = 32 1 641 x 64 = 64 1 1281 x 128 = 128 Total245

8 University of Texas Pan AmDr. John P. Abraham

9 University of Texas Pan AmDr. John P. Abraham

10 University of Texas Pan AmDr. John P. Abraham

11 University of Texas Pan AmDr. John P. Abraham Signed binary signed-magnitude The most significant bit (MSB) is set aside to indicate the sign, zero for positive and 1 for negative. One’s-complement The MSB of a negative number will begin with a one and a positive number with a zero. 0011 will represent +3 and 1100 (complement of the positive 3) will represent -3. Two’s-complement. a negative number is represented by complementing the bits of the positive number and adding a 1. a –3 is represented as 1101 (complement of 0011 is 1100, and add a 1).

12 University of Texas Pan AmDr. John P. Abraham Two’s complement a binary number’s MSB is a zero then it is a positive and no further action is necessary. If the MSB is 1, it is a negative number. Suppose the number is 10000001, we know it is a negative number. Complement the bits and add a 1, we get 01111110 +1 = 01111111 which is 127. The sign is already determined to be negative it is –127.

13 University of Texas Pan AmDr. John P. Abraham ASCII Character Set a specific binary sequence must be established for representing the alphabets, numeric symbols and other special symbols that are in use in English as well as other languages of the world. An agreement was reached in 1968 to represent all English alphabets The standard ASCII character set consists of 128 decimal numbers ranging from zero through 127 The Extended ASCII Character Set also consists of 128 decimal numbers and ranges from 128 through 255 representing additional special, mathematical, graphic, and some foreign characters.

14 University of Texas Pan AmDr. John P. Abraham ASCII Character Set The first 32 (0 to 31) ASCII codes are for special purposes such as line feed, carriage return, form feed, bell, etc. The ASCII can only represent languages that use Roman Alphabets such as English. To represent an ASCII character we need 7 bits and an extended ASCII character requires 8 bits; therefore, we set aside a byte for it and a byte happens to be the smallest addressable memory unit.

15 University of Texas Pan AmDr. John P. Abraham Unicode Unicode provides a unique number for every character regardless of the platform, the program, or the language. Unicode uses two bytes to represent one character. This means we can have 65,536 possible symbols in a given alphabet. encoding scheme that IBM mainframes used is the Extended Binary Coded Decimal Interchange Code (EBCDIC).

16 University of Texas Pan AmDr. John P. Abraham Numbering schemes Binary Octal –Since the basic addressable memory unit is a byte an octal (base eight) makes sense and some early computers used the octal system. Octal numbering system uses 8 symbols, 0 to 7. The next number after 7 is 10. Hexadecimal

17 University of Texas Pan AmDr. John P. Abraham Hexadecimal Hexadecimal (base 16) numbers give more compactly written numbers and programmers use it very often. It uses 15 symbols 0-9 and A-F. The A stands for decimal 10, B for 11, C for 12, D for 13, E for 14 and F for 15. These 15 symbols can be represented using four bits or a nibble. For example, 1111 will represent F (decimal 15). Two hexadecimal digits can be represented in one byte; FF representing 255. After the F, the next number is 10 (decimal 16).

18 University of Texas Pan AmDr. John P. Abraham Boolean Operations The mathematics used in digital systems is the special case of Boolean Algebra. – the variables only assumes only two values (0 or 1). The basic operations of Boolean Algebra are: NOT, AND, OR, XOR, NAND and NOR.

19 University of Texas Pan AmDr. John P. Abraham Not gate The NOT operation gives the inverse (complement) of a Boolean variable. For example NOT(True) is false.

20 University of Texas Pan AmDr. John P. Abraham AND gate The AND operation is a logical multiplication. An example: IF US CITIZEN AND AGE GREATER THAN OREQUAL TO 18 THEN ELIGIBLE TO VOTE. There are two inputs, citizenship and age, and one output, voting eligibility, in this example. In a situation where a person is a US citizen and 20 years of age, the inputs will be TRUE and TRUE. The output also will be TRUE. If one or both of the inputs are FALSE then the output will be FALSE.

21 University of Texas Pan AmDr. John P. Abraham AND gate

22 University of Texas Pan AmDr. John P. Abraham

23 University of Texas Pan AmDr. John P. Abraham OR gate The OR operation is a local addition. An example: If grade == 90 or grade >90 then Grade = ‘A’. In an OR operation only one condition has to be true for the output to be true.

24 University of Texas Pan AmDr. John P. Abraham OR gate

25 University of Texas Pan AmDr. John P. Abraham

26 University of Texas Pan AmDr. John P. Abraham XOR gate

27 University of Texas Pan AmDr. John P. Abraham NOR Gate

28 University of Texas Pan AmDr. John P. Abraham Half Adder #include void main() { short x,y, sum, carry; bool a,b,c,d; cout > x>>y; a=x==1; b=y==1; //actually c++ assigns 0 for false and 1 for true, we could have read these directly; c=(a||b) && !(a&&b); d=(a&&b); 9 sum=c?1:0; //if c is true then sum gets 1 else sum gets 0 carry=d?1:0; cout <<x <<"+"<<y <<"="<<carry<<sum<<endl; if (a = true) cout <<"it is true"; if (a) cout << "it is ture"; }

29 University of Texas Pan AmDr. John P. Abraham Computer Programming Languages Computers perform operations such as moving data and data manipulation by activating switches and gates. Instructions to do that also must be given in the form of 1s and 0s or on and off. When we program computers using just ones and zeros we are using the “machine language”.

30 University of Texas Pan AmDr. John P. Abraham Structure of 8088 Microprocessor execution unit (EU) the bus interface unit (BIU)

31 University of Texas Pan AmDr. John P. Abraham Execution Unit (EU) the control logic for decoding and executing instructions ALU for performing arithmetic and logic operations A set of general purpose registers

32 University of Texas Pan AmDr. John P. Abraham Bus interface unit (BIU) A bus is a set of wires that connects the various components of a computer together and transfers signals and data between them. The number of lines a bus has depends on the architecture of the microprocessor and is directly proportional to the CPU speed. –Control Data Address

33 University of Texas Pan AmDr. John P. Abraham 3 Functions of the BUS memory address transfers, data transfers and control signal transfers. One set of physical wires may handle all three operations one at a time, or there may be different sets of wires for each, the address bus, data bus and the control bus. If we say that the hypothetical processor is 16 bit, then 16 bits of data should be transferred at the same time.

34 University of Texas Pan AmDr. John P. Abraham

35 University of Texas Pan AmDr. John P. Abraham Major microprocessor components PC- Program Counter MBR- Memory Buffer Register MAR- Memory Address Register ALU- Arithmetic Logic Unit IR- Instruction Register General Purpose Registers.

36 University of Texas Pan AmDr. John P. Abraham

37 University of Texas Pan AmDr. John P. Abraham Microprocessor operation When a program begins execution, the program counter (PC, a register inside the CPU) has the address of the next instruction to fetch. this address is placed there initially by the operating system and updated automatically by the CPU. There are three additional registers, the instruction register (IR), memory address register (MAR) and the memory buffer register (MBR) that work together to fetch the instruction.

38 University of Texas Pan AmDr. John P. Abraham Microprocessor Operation (2) The address from the PC is moved to the MAR. –The reason for this is that the address bus is connected to the MAR and all addresses issued must go through this register. Then the address contained in the MAR is placed on the address bus and the READ line is asserted on the control bus.

39 University of Texas Pan AmDr. John P. Abraham Microprocessor Operation(3) The memory whose address is found on the address bus places its contents on the data bus. The only register that is connected to the data bus is the MBR, and all data should go in an out through this register. Thus the data on the data bus is copied into the MBR. The instruction is now copied on to the IR to free up the MBR to handle another transfer.

40 University of Texas Pan AmDr. John P. Abraham Microprocessor Operation(4) The contents of the PC will be now incremented by one instruction. The instruction is then decoded and executed. In practice, more than one instruction is read during an instruction cycle. Additional instructions are kept in temporary storage registers such as the Instruction Buffer Register (IBR).

41 University of Texas Pan AmDr. John P. Abraham The Program Counter The size of the PC depends on the number of address lines of the CPU. Let us assume that the CPU has 16 address lines. Then the PC should be able to address 65,536 locations. Initially the CPU starts its operation based on the contents of the PC. Assume that initially the PC contains the value 0000h where “h” stands for hexadecimal notation.

42 University of Texas Pan AmDr. John P. Abraham The Fetch Cycle MAR holds the address of the memory location from which the instruction is to be fetched. At the start up, the CPU performs an instruction fetch. Instruction fetch involves reading the instruction stored in the memory. The location from which the instruction is read is derived from the PC.

43 University of Texas Pan AmDr. John P. Abraham The Decode Cycle An instruction will have an opcode and none, one or more operands (data to operate on) The opcode is defined as the type of operation the CPU has to perform. The number of bits assigned to the opcode will determine the maximum number of instructions that processor is allowed to have.

44 University of Texas Pan AmDr. John P. Abraham Opcode suppose that the length of an instruction (opcode and operand) is 16 bits, 4 bits are allocated for the instructions and the remaining 12 bits are allocated for an operand. Four bits can give us a maximum of sixteen instructions. Each of these 16 bit patterns, ranging from decimal 0 to 15, or binary 0 to 1111, or hexadecimal 0 to F will stand for a particular instruction.

45 University of Texas Pan AmDr. John P. Abraham Instruction set of an imaginary computer

46 University of Texas Pan AmDr. John P. Abraham Operations of a Microprocessor This hypothetical computer has only one user addressable register, which is the accumulator (AC). When a load (LD) is executed, the contents of the location as indicated by the operand is brought into the AC The reverse happens in a store (ST).

47 University of Texas Pan AmDr. John P. Abraham Operations of a Microprocessor(2) When an add (A) is executed, the value contained in the memory location as indicated by the operand is added to the contents of the AC, and the result is placed back in the AC. The add immediate (AI) differs from the add (A) in that the operand is what is added, not the content of the memory pointed by the operand.

48 University of Texas Pan AmDr. John P. Abraham Program Example B = B + A C = B + 2 The variable A is kept in memory location 200h Variable B in 201h Variable C in 202h. The values in each are 5, 3 and 0 respectively.

49 University of Texas Pan AmDr. John P. Abraham Program Example (2) There are three registers that need watching, the Accumulator (AC), Program Counter (PC), and the Instruction Register (IR). The PC contains 100h, which means that the next instruction should be fetched from memory location 100 hexadecimal.

50 University of Texas Pan AmDr. John P. Abraham Program Example (3) – The code

51 University of Texas Pan AmDr. John P. Abraham Program Example (4) The control unit fetches the instruction contained in the address indicated by the PC, which is 100h. The instruction 0200 is brought into the IR. The IR now contains 0200. The instruction is decoded and separated in opcode of 0 and operand of 200. This is based on the assumption that 4 bits (one hexadecimal digit) are used for the opcode and 12 bits (three hexadecimal digits) are used for the operand.

52 University of Texas Pan AmDr. John P. Abraham

53 University of Texas Pan AmDr. John P. Abraham Program Example (5) Once the instruction is fetched the PC is automatically incremented, and now contains 101h. The opcode 0 indicates a load, and the operand is fetched from memory location 200h and loaded into the accumulator (AC). Now the accumulator contains 5.

54 University of Texas Pan AmDr. John P. Abraham

55 University of Texas Pan AmDr. John P. Abraham Program Example (6) The instruction from 101h is fetched and placed in the IR. The PC is incremented to 102h. The content of IR is decoded and based on the opcode of 2, the operand located in address 201h is added to the AC. The AC now has a value of 8.

56 University of Texas Pan AmDr. John P. Abraham

57 University of Texas Pan AmDr. John P. Abraham Program Example (7) The next instruction whose address is contained in the PC is fetched and placed in the IR giving it a value of 1201. The PC is incremented to 103h. The contents of IR (1201) is decoded and based on the opcode of 1, the contents of the AC is saved in the address indicated by the operand, which is 201h. Address 201 (variable B) now has a value of 8.

58 University of Texas Pan AmDr. John P. Abraham

59 University of Texas Pan AmDr. John P. Abraham Program Example (8) The instruction contained in 103h (PC content) is fetched next and placed in the IR giving it a value of 3002. The PC is incremented to 104h The contents of IR is decoded, and based on the opcode of 3 it is an add immediate. No data fetching is necessary and the 2 is added to the AC. The new value of the accumulator is now 10.

60 University of Texas Pan AmDr. John P. Abraham

61 University of Texas Pan AmDr. John P. Abraham Program Example (9) The last instruction is now fetched and placed in IR. The PC is incremented to 105h. The PC now contains 1202, and it is decoded to give the opcode of 1 and operand of 202. Since hex 1 is a store, the value of AC (the value is 10) is stored in memory location 202h. It was already mentioned that 202h is the memory location assigned to C.

62 University of Texas Pan AmDr. John P. Abraham

63 University of Texas Pan AmDr. John P. Abraham Slides from textbook The following are taken from Dale and Lewis book

64 University of Texas Pan AmDr. John P. Abraham 64 Chapter Goals List the operations that a computer can perform Describe the important features of the Pep/8 virtual machine Distinguish between immediate addressing mode and direct addressing mode Write a simple machine-language program Distinguish between machine language and assembly language

65 University of Texas Pan AmDr. John P. Abraham 65 Computer Operations Computer A programmable electronic device that can store, retrieve, and process data Data and instructions to manipulate the data are logically the same and can be stored in the same place What operations can a computer execute?

66 University of Texas Pan AmDr. John P. Abraham 66 Machine Language Machine language The language made up of binary coded instructions built into the hardware of a particular computer and used directly by the computer Why would anyone choose to use machine language? (Hint: they had no choice. Why?)

67 University of Texas Pan AmDr. John P. Abraham 67 Machine Language Characteristics of machine language: –Every processor type has its own set of specific machine instructions –The relationship between the processor and the instructions it can carry out is completely integrated –Each machine-language instruction does only one very low-level task

68 University of Texas Pan AmDr. John P. Abraham 68 Pep/8 Virtual Computer Virtual computer A hypothetical machine designed to contain the important features of a real computer that we want to illustrate Pep/8 A virtual computer designed by Stanley Warford that has 39 machine-language instructions No; we are not going to cover all of them!

69 University of Texas Pan AmDr. John P. Abraham 69 Features in Pep/8 Pep/8 Registers/Status Bits Covered –The program counter (PC) (contains the address of the next instruction to be executed) –The instruction register (IR) (contains a copy of the instruction being executed) –The accumulator (A register) The memory unit is made up of 65,636 bytes of storage

70 University of Texas Pan AmDr. John P. Abraham 70 Architecture of Pep/8 Figure 6.1 Pep/8’s Architecture

71 University of Texas Pan AmDr. John P. Abraham Instruction Format Figure 6.2 Pep/8 Instruction Format 71

72 University of Texas Pan AmDr. John P. Abraham 72 Instruction Format Operation code Specifies which instruction is to be carried out Register specifier Specifies which register is to be used (only use A in this chapter) Addressing-mode specifier Says how to interpret the operand part of the instruction

73 University of Texas Pan AmDr. John P. Abraham Instruction Format Figure 6.3 Difference between immediate addressing mode and direct addressing mode 73

74 University of Texas Pan AmDr. John P. Abraham 74 Some Sample Instructions Figure 6.4 Subset of Pep/8 instructions

75 University of Texas Pan AmDr. John P. Abraham 75 Sample Instructions What do these instructions mean?

76 University of Texas Pan AmDr. John P. Abraham 76 Sample Instructions What do these instructions mean?

77 University of Texas Pan AmDr. John P. Abraham 77 Sample Instructions What do these instructions mean?

78 University of Texas Pan AmDr. John P. Abraham 78 Sample Instructions What do these instructions mean? Why is there only one on this page?

79 University of Texas Pan AmDr. John P. Abraham 79 Sample Instructions What do these instructions mean?

80 University of Texas Pan AmDr. John P. Abraham Written Algorithm of Hello 80

81 University of Texas Pan AmDr. John P. Abraham 81 Hand Simulation What is the fetch/execute cycle? How much is the PC incremented?

82 University of Texas Pan AmDr. John P. Abraham 82 Hand Simulation What is the fetch/execute cycle here?

83 University of Texas Pan AmDr. John P. Abraham 83 Pep/8 Simulator Pep8/Simulator A program that behaves just like the Pep/8 virtual machine behaves To run a program Enter the hexadecimal code, byte by byte with blanks between each

84 University of Texas Pan AmDr. John P. Abraham 84 Pep/8 Simulator What are the "zz"s for?

85 University of Texas Pan AmDr. John P. Abraham 85 Pep/8 Simulator load execute

86 University of Texas Pan AmDr. John P. Abraham 86 Pep/8 Simulator What is a loader? What does it do? Where does execution begin? replace E0 with 50 in 5 places

87 University of Texas Pan AmDr. John P. Abraham Pep/8 Simulator

88 University of Texas Pan AmDr. John P. Abraham What does this program do? Pep/8 Simulator

89 University of Texas Pan AmDr. John P. Abraham 89 Assembly Language Assembly language A language that uses mnemonic codes to represent machine-language instructions Assembler A program that reads each of the instructions in mnemonic form and translates it into the machine- language equivalent

90 University of Texas Pan AmDr. John P. Abraham 90 Pep/8 Assembly Language Remember the difference between immediate and direct addressing? i : immediate d: direct

91 University of Texas Pan AmDr. John P. Abraham 91 Pep/8 Assembly Language What is the difference between operations and pseudo operations?

92 University of Texas Pan AmDr. John P. Abraham 92 Pep/8 Assembly Language Program "Hello" CHARO0x0048,i; Output an 'H' CHARO0x0065,i;Output an 'e' CHARO0x006C,i; Output an 'l' CHARO0x006F,i;Output an 'o' STOP.END

93 University of Texas Pan AmDr. John P. Abraham 93 Pep/8 Assembly Language

94 University of Texas Pan AmDr. John P. Abraham 94 Assembly Process

95 University of Texas Pan AmDr. John P. Abraham 95 A New Program Problem: Read and sum three values and print the sum How would you do it by hand?

96 University of Texas Pan AmDr. John P. Abraham 96 Our Completed Program BR main sum:.WORD 0x0000 num1:.BLOCK 2 num2:.BLOCK 2 num3:.BLOCK 2 main: LDA sum,d DECI num1,d ADDA num1,d DECI num2,d ADDA num2,d DECI num3,d ADDA num3,d STA sum,d DECO sum,d STOP.END

97 University of Texas Pan AmDr. John P. Abraham 97 Decision Making BRLTiSet PC to operand if A < 0 BREQISet PC to operand if A = 0 negMsg:CHARO0x0045,i BRfinish main:LDAsum,d … BRLTnegMsg STAsum,d DECOsum,d finish:STOP How many ways to finish?

98 University of Texas Pan AmDr. John P. Abraham 98 Decision Making Problem: Read and sum limit values. How many values? Where does this value come from? Will require repeating the reading and summing How do we know when we are done?

99 University of Texas Pan AmDr. John P. Abraham 99 Pseudocode A mixture of English and formatting to make the steps in an algorithm explicit Algorithm to Convert base-10 number to other bases While ( the quotient is not zero ) Divide the decimal number by the new base Make the remainder the next digit to the left in the answer Replace the original decimal number with the quotient

100 University of Texas Pan AmDr. John P. Abraham 100 Following an Algorithm

101 University of Texas Pan AmDr. John P. Abraham 101 Following an Algorithm Algorithm for preparing a Hollandaise sauce IF concerned about cholesterol Put butter substitute in a pot ELSE Put butter in a pot Turn on burner Put pot on the burner WHILE (NOT bubbling) Leave pot on the burner Put other ingredients in the blender Turn on blender WHILE (more in pot) Pour contents into lender in slow steam Turn off blender

102 University of Texas Pan AmDr. John P. Abraham 102 Developing an Algorithm Two methodologies used to develop computer solutions to a problem –Top-down design focuses on the tasks to be done –Object-oriented design focuses on the data involved in the solution But first, let's look at a way to express algorithms: pseudocode

103 University of Texas Pan AmDr. John P. Abraham 103 Pseudocode A way of expressing algorithms that uses a mixture of English phrases and indentation to make the steps in the solution explicit There are no grammar rules in pseudocode Pseudocode is not case sensitive

104 University of Texas Pan AmDr. John P. Abraham 104 Following Pseudocode What is 93 in base 8? 93/8 gives 11 remainder 5 11/6 gives 1 remainder 3 1/ 8 gives 0 remainder 1 answer 1 3 5 While ( the quotient is not zero ) Divide the decimal number by the new base Make the remainder the next digit to the left in the answer Replace the original decimal number with the quotient

105 University of Texas Pan AmDr. John P. Abraham 105 Following Pseudocode Easier way to organize solution

106 University of Texas Pan AmDr. John P. Abraham 106 Pseudocode for Complete Computer Solution Write "Enter the new base" Read newBase Write "Enter the number to be converted" Read decimalNumber Set quotient to 1 WHILE (quotient is not zero) Set quotient to decimalNumber DIV newBase Set remainder to decimalNumber REM newBase Make the remainder the next digit to the left in the answer Set decimalNumber to quotient Write "The answer is " Write answer

107 University of Texas Pan AmDr. John P. Abraham 107 Pseudocode Functionality Variables Names of places to store values quotient, decimalNumber, newBase Assignment Storing the value of an expression into a variable Set quotient to 64 quotient <-- 64 quotient <-- 6 * 10 + 4

108 University of Texas Pan AmDr. John P. Abraham 108 Pseudocode Functionality Output Printing a value on an output device Write, Print Input Getting values from the outside word and storing them into variables Get, Read

109 University of Texas Pan AmDr. John P. Abraham 109 Pseudocode Functionality Repetition Repeating a series of statements Set count to 1 WHILE ( count < 10) Write "Enter an integer number" Read aNumber Write "You entered " + aNumber Set count to count + 1 How many values were read?

110 University of Texas Pan AmDr. John P. Abraham 110 Pseudocode Functionality Selection Making a choice to execute or skip a statement (or group of statements) Read number IF (number < 0) Write number + " is less than zero." or Write "Enter a positive number." Read number IF(number < 0) Write number + " is less than zero." Write "You didn't follow instructions."

111 University of Texas Pan AmDr. John P. Abraham 111 Pseudocode Functionality Selection Choose to execute one statement (or group of statements) or another statement (or group of statements) IF ( age < 12 ) Write "Pay children's rate" Write "You get a free box of popcorn" ELSE IF ( age < 65 ) Write "Pay regular rate" ELSE Write "Pay senior citizens rate"

112 University of Texas Pan AmDr. John P. Abraham 112 Pseudocode Example Problem: Read in pairs of positive numbers and print each pair in order. WHILE (not done) Write "Enter two values separated by blanks" Read number1 Read number2 Print them in order

113 University of Texas Pan AmDr. John P. Abraham 113 Pseudocode Example How do we know when to stop? Let the user tell us how many Print them in order? If first number is smaller print first, then second If first number if larger print second, then first

114 University of Texas Pan AmDr. John P. Abraham 114 Pseudocode Example Write "How many pairs of values are to be entered?" Read numberOfPairs Set numberRead to 0 WHILE (numberRead < numberOfPairs) Write "Enter two values separated by a blank; press return" Read number1 Read number2 IF(number1 < number2) Print number1 + " " + number2 ELSE Print number2 + " " number1 Increment numberRead

115 University of Texas Pan AmDr. John P. Abraham 115 Walk Through DataFill in values during each iteration 3numberRead number1number2 55 70 2 1 33 numberOfPairs What is the output?

116 University of Texas Pan AmDr. John P. Abraham 116 Translating Pseudocode To What? Assembly language Very detailed and time consuming High-level language Easy as you'll see in Chapter 9

117 University of Texas Pan AmDr. John P. Abraham 117 Testing Test plan A document that specifies how many times and with what data the program must be run in order to thoroughly test it Code coverage An approach that designs test cases by looking at the code Data coverage An approach that designs test cases by looking at the allowable data values

118 University of Texas Pan AmDr. John P. Abraham 118 Testing Test plan implementation Using the test cases outlined in the test plan to verify that the program outputs the predicted results

119 University of Texas Pan AmDr. John P. Abraham Important Threads Operations of a Computer Computer can store, retrieve, and process data Computer’s Machine Language A set of instructions the machine’s hardware is built to recognize and execute Machine-language Programs Written by entering a series of these instructions in binary form 119

120 University of Texas Pan AmDr. John P. Abraham Important Threads Pep/8: A Virtual Computer with One Register (A) and two-part instructions: One part tells which action the instruction performs; the other part details where the data to be used can be found Pep/8 Assembly Language A language that permits the user to enter mnemonic codes for each instruction rather than binary numbers Pseudocode Shorthand-type language people use to express algorithms 120

121 University of Texas Pan AmDr. John P. Abraham Important Threads Testing Programs All programs must be tested; code coverage testing and data coverage (black-box testing) two common approaches 121

122 University of Texas Pan AmDr. John P. Abraham 122 Ethical Issues Software Piracy and Copyrighting Have you every "borrowed" software from a friend? Have you ever "lent" software to a friend? Did you know that 107,000 jobs were lost in the US one year due to such "borrowing" and "lending?"


Download ppt "University of Texas Pan AmDr. John P. Abraham Information Technology Computer Architecture Dr. John P. Abraham."

Similar presentations


Ads by Google