Princess Sumaya Univ. Computer Engineering Dept. Chapter 2: IT Students
Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 1 / 9 Basic Computer Organization The 5 Classic Components of a Computer The Basic Hardware/Software Interface The Stored-Program Concept IT Students
Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 2 / 9 RISC & CISC Reduced Instruction Set Computer ●The storage concept (32 bits): ♦ Registers (R1, R2 … R31) ♦ Memory ●Arithmetic operations: ♦ Simple ♦ Limited to registers Complicated Instruction Set Computer ●IA-32 IT Students
Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 3 / 9 Instructions Assembly Language Instruction: Perform:a = b + c ADDa, b, c; a b + c What are ‘a’, ‘b’ and ‘c’? Sequence of Instructions: Perform: a = (b + c) – (d + e) IT Students
Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 4 / 9 Memory Operands Data Transfer Instructions ●Memory Address (Location) ●Slower than registers Load and Store Instructions Memory IT Students
Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 5 / 9 Constant Operands Memory Operands Perform a = b + 4 Immediate Operands Memory b IT Students
Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 6 / 9 Memory Access Height and Width 1 KB 4 KB Address & Data 16 Locations 1 K Locations 1 M Locations Read & Write Memory bit 1 KB IT Students
Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 7 / 9 Stored Program Architecture Instructions (Program) Operands (Data) Memory 1024 x 32 OpcodeOperands Binary Operand IT Students
Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 8 / 9 Memory Organization Byte Access Word Access 20 Byte 21 Byte 20 Byte Byte Byte Byte 24 Byte Byte Byte Byte 20 Byte Byte 22 Byte Byte IT Students
Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. 9 / 9 Instruction Representation Instruction Format Machine Language & Machine Code Sequence of instructions OpcodeOperands ADD R1, R2, F F Assembly Language Machine Language IT Students
Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. Chapter 2
Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. Chapter 2 Exercise 1 Write an assembly language program to perform a+2b where ‘a’ and ‘b’ are stored in R1 and R2. Write an assembly language program to swap two locations at memory addresses 10 and 20. Rewrite the following program to run faster: SUB R1, R1, R1 INC R1 ADD R2, R3, R1 A memory has 4 bits of address and 4 bits of data. Determine the total number of bits inside it. IT Students
Princess Sumaya University – Computer Org. & Assembly Lang. Computer Engineering Dept. Chapter 2 Exercise 2 Determine the value of R1: LD R1, M [ 43 ] Write the assembly instruction at 44. Assuming 8-bit registers, determine the value of R1: Load Immediate R1, Binary ‘ ’ Arith Shift Right R1 Assuming i and j are integers, R1= i and R2 = j, write the C- language statement for: Compare R1, R2 Jump Equal Label_1 Clear R1 Label_1: Clear R2 IT Students Opcode Operand 1 Operand 2 Operand 3 Add (= B1)Reg (5 bits) Add (= B2)Reg (5 bits) Constant