210 likes | 331 Views
CSC 235. Computer Organization. Computer Organizaton. Top_Level Structure The von-Neumann Machine Stack Machine Accumulator Machine Load/Store Machine Assemblers. Top Level Structure. Input/Output Main Memory Central Processing Unit (CPU) System Interconnection (Bus).
E N D
CSC 235 Computer Organization
Computer Organizaton • Top_Level Structure • The von-Neumann Machine • Stack Machine • Accumulator Machine • Load/Store Machine • Assemblers
Top Level Structure • Input/Output • Main Memory • Central Processing Unit (CPU) • System Interconnection (Bus)
Structure - Top Level Computer Peripherals Central Processing Unit Main Memory Computer Systems Interconnection Input Output Communication lines
Structure - The CPU CPU Arithmetic and Login Unit Computer Registers I/O System Bus CPU Internal CPU Interconnection Memory Control Unit
The von Neumann Machine • Stored Program concept • Main memory storing programs and data • ALU operating on binary data • Control unit interpreting instructions from memory and executing • Input and output equipment operated by control unit • Princeton Institute for Advanced Studies • IAS • Completed 1952
Structure of von Neumann machine Arithmetic and Logic Unit Input Output Equipment Main Memory Program Control Unit
IAS - details • 1000 x 40 bit words • Binary number • 2 x 20 bit instructions • Set of registers (storage in CPU) • Memory Buffer Register • Memory Address Register • Instruction Register • Instruction Buffer Register • Program Counter • Accumulator • Multiplier Quotient
Structure of IAS - detail Central Processing Unit Arithmetic and Logic Unit Accumulator MQ Arithmetic & Logic Circuits MBR Input Output Equipment Instructions & Data Main Memory PC IBR MAR IR Control Circuits Address Program Control Unit
The execution cycle • PC = 0; // program counter initialized • Do • { INSTRUCTION = MEMORY[PC]; PC++; DECODE(INSTRUCTION); FETCH(OPERANDS); EXECUTE; STORE(RESULTS); } WHILE (INSTRUCTION != HALT)
The Stack Machine • All operations use the top of Stack. • Operands are on top of stack • Operation pops its operands from the top of stack. • Operation is performed • The result is pushed back on the top of stack • See figure 1.3 of text (next slide).
x = a + b; • Push a; // fetch a from memory and push it onto stack • Push b; // fetch b from memory and push it onto stack • Add // pop top two values from top of stack, add them and push result onto stack • Store x // pop top value off stack and put it in memory location of x
Accumulator Machines • One operand is in the special register called the accumulator • The other operand (if any) is found in memory • The operation is performed and the result is left in the accumulator
x = a + b; • Load a; // fetch a from memory and put in accumulator • add b; // fetch b from memory and and add it to the accumulator • leaving the answer in the accumulator • Store x // copy accumulator to memory location of x
Load/Store Machines • Each operand is in a register • The operation is performed using the appropriate registers • The result is put in a register
Load/Store Variations • PDP-11 • VAX 11 • Motorola 68000 • Intel 80x86 • Sun Microsystems SPARC computers
PDP, VAX, Motorolax = a + b • move a, r0 // r0 = a • move b, r1 // r1 = b • add r0, r1 // r1 = r0 + r1 • move r1, x // x = r1
Assemblers • All code/data is in binary • Hard for humans to understand • Assemblers allow mnemonics to be used • Assemblers allow names for memory locations • Assemblers allow labels to used on instructions • Different machines have different assemblers • Same machines can have different assemblers
Setting Up for sa • Make the directory bin in your home directory. Use emacs to add $home/bin to your path variable in your .login file. • Make sure the directory /usr/ccs/bin is in your path variable in your .login file. If not, put it there, then save .login. • Copy the program sa from the public directory /export/home/public/spiegel/csc235 to your bin directory. • Give the command source .login to make the changes effective.
Testing sa • Make a directory csc235 in your home directory. • Copy the file addxy.m from the public directory to the csc235 directory. • Give the command saaddxy to test the setup of sa. If it does not compile and run correctly, re-check the previous steps. If it still does not work, see a GA or your professor.