Basic Computer Organization

download Basic Computer Organization

of 19

description

Computer Architecture

Transcript of Basic Computer Organization

  • Basic Computer OrganizationTE 091335 Computer Organization and Architecture

  • TRIRACDRMemory Unit4096 x 16PCAROUTRINPRAdder &LogicBusE*S0S1S27123456

  • TRIRACDRMemory Unit4096 x 16PCAROUTRINPR*Write ReadLD INR CLRLD INR CLRLD INR CLRLD INR CLRLD INR CLRLDLDRegistersClock

  • Memory Reference Instructions*

    SymbolI = 0I = 1DescriptionAND0xxx8xxxAND memory word to ACADD1xxx9xxxAdd memory word to ACLDA2xxxAxxxLoad memory word to ACSTA3xxxBxxxStore content of AC to memoryBUN4xxxCxxxBranch unconditionallyBSA5xxxDxxxBranch and save return addressISZ6xxxExxxIncrement and skip if zero

  • Register Reference Instructions*

    SymbolCodeDescriptionCLA7800Clear ACCLE7400Clear ECMA7200Complement ACCME7100Complement ECIR7080Circulate right AC and ECIL7040Circulate left AC and EINC7020Increment ACSPA7010Skip next instruction if AC positiveSNA7008Skip next instruction if AC negativeSZA7004Skip next instruction if AC zeroSZE7002Skip next instruction if E is zeroHLT7001Halt computer

  • Input Output Instructions*

    SymbolCodeDescriptionINPF800Input character to ACOUTF400Output character from ACSKIF200Skip on input flagSKOF100Skip on output flagIONF080Interrupt onIOFF040Interrupt off

  • *3x8Decoder7 6 5 4 3 2 1 0Control LogicGates 15 14 13 12 11 10 9 8 7 6 5 04x16Decoder4-bitSequenceCounter (SC)I15141312110Control outputIncrement (INR)Clear (CLR)Clock

  • * BusMemory UnitIRARPCS0

    S1

    S2ReadLDINRLD7125T1T0

  • Instruction Cycle*Fetch an instruction from memoryDecode the instructionRead the effective address from memory if the instruction has an indirect addressExecute the instruction

    T0: AR PCT1: IR M[AR], PC PC + 1T2: D0, , D7 Decode IR(12-14), AR IR(0-11), I IR(15)

  • *StartSC 0AR PCIR M[AR], PC PC + 1Decode IR(12-14), AR IR(0-11), I IR(15)Execute I/O InstructionSC 0Execute RRISC 0 Execute MRI SC 0AR M[AR]NothingD7IIT0T1T2T3T3T3T3T4

  • RRI*D7IT3 = r (common to all RRI)IR(i) = Bi (bit in IR(0-11) that specifies the operation)

    SymbolSignalStages rSC 0Clear SCCLArB11AC 0Clear ACCLErB10E 0Clear ECMArB9AC ACComplement ACCMErB8E EComplement ECIRrB7AC shrAC, AC(15) E, E AC(0)Circulate rightCILrB6AC shlAC, AC(0) E, E AC(15)Circulate leftINCrB5AC AC + 1Increment ACSPArB4If(AC(15) = 0) then PC PC + 1Skip if positiveSNArB3If(AC(15) = 1) then PC PC + 1Skip if negativeSZArB2If(AC = 0) then PC PC + 1Skip if AC zeroSZErB1If(E = 0) then PC PC + 1Skip if E zeroHLTrB0S 0 (Start-Stop flip-flop)Halt computer

  • MRI (1)*ANDD0T4: DR M[AR]D0T5: AC AC DR, SC 0ADDD1T4: DR M[AR]D1T5: AC AC + DR, E Cout, SC 0LDAD2T4: DR M[AR]D2T5: AC DR, SC 0STAD3T4: M[AR] AC, SC 0BUND4T4: PC AR, SC 0

  • MRI (2)*BSA D5T4: M[AR] PC, AR AR + 1D5T5: PC AR, SC 0ISZD6T4: DR M[AR]D6T5: DR DR + 1D6T6: M[AR] DR, if(DR = 0) then (PC PC + 1), SC 00 BSA 135Next Instruction1 BUN 1350 BSA 13521SubroutineSubroutineNext Instruction1 BUN 135 20 PC = 21

    AR = 135 136

    20 21

    135PC = 136

  • Exercise (1)A computer uses a memory unit with 256K words of 332 bits each. A binary instruction code is stored in one word of memory. The instruction has four parts: an indirect bit, an operation code, a register code part to specify one of 64 registers, and an address part.How many bits are there in the operation code, the register code part, and the address part?Draw the instruction word format and indicate the number of bits in each part.How many bits are there in the data and address inputs of the memory?

  • Exercise (2)The following register transfers are to be executed in the basic computer. For each transfer specify: (1) the binary value that must be applied to bus select input S2, S1, S0; (2) the register whose LD control input must be active (if any); (3) a memory read or write operation (if needed); and (4) the operation in the adder and logic circuit (if any).AR PCIR M[AR]M[AR] TRAC DR, DR AC (done simultaneously)

  • Exercise (3)Explain why each of the following micro operations cannot be executed during a single clock pulse in the basic computer. Specify a sequence of micro operations that will perform the operation.IR M[PC]AC AC + TRDR DR + AC (AC does not change)

  • Exercise (4)Consider the instruction format and the list of instruction in the basic computer. For each of the following 16-bit instructions, give the equivalent four digit hexadecimal code and explain in your own words what the instruction is going to perform.0001 0000 0010 01001011 0001 0010 01000111 0000 0010 0000

  • Exercise (5)The content of AC in the basic computer is A937 and the initial value of E is 1. Determine the contents of AC, E, PC, AR, and IR in hexadecimal after the execution of the CLA instruction. Repeat 11 more times, starting from each one of the register reference instructions. The initial value of PC is hexadecimal 021.

  • Exercise (6)The content of PC in the basic computer is 3AF (all numbers are in hexadecimal). The content of AC is 7EC3.The content of memory at address 3AF is 932E. The content of memory at address 32E is 09AC. The content of memory at address 9AC is 8B9F.What is the instruction that will be fetched and executed next?Show the binary operation that will be performed in the AC when the instruction is executed.Give the contents of PC, AR, DR, AC and IR (hexadecimal) and the values of E, I and SC (binary) at the end of the instruction cycle.

    *