Learn an 8-Bit CPU

Objective of this lab:


	To study the operation of an 8-bit CPU and control unit. 

Preparation


	Read lab lecture notes and the material in this page.

Lab Assignments

  1. Obtain an 8-bit CPU working circuit file
    
           ~ftp/pub/class/301/ftp/8bitcpu.cct
    
    

    The circuit just obtained is a 8 bit version of the 1 bit CPU we built in last lab with a few additions:
    
    	To get a feel for the circuit before more details are examined, 
    	do the following: 
        
    	1.	load the number 8 into memory location 2 
    
    	2.	move (the contents in) memory location 2 to the PC 
    
    	3.	increment the PC 
          
           
          Write down the signals with the microinstructions to hand-in:
    
            ________________________________
    
            ________________________________
    
            ________________________________
    
            ________________________________
    
    
  2. Execute the program (Hand in)
    
    a).	Write out the equivalent assembly language mnemonics of the following 
    	machine language code:
      
    
    	
    
          Location 	Contents 	Assembly Language Mnemonics 
          =============================================================
          0 	10000001  
          -------------------------------------------------------------
          1 	00010110  
          -------------------------------------------------------------
          2 	00000101  
          -------------------------------------------------------------
          3 	00001000  
          -------------------------------------------------------------
    
    
    b). Load the preceding program (in machine code) to the memory. c). Pre-load value 1 in the B register, preload 0 in the memory location 8. Make sure the PC points to the beginning of the program. d). Write out the microinstructions necessary to execute the program. Hand in the procedures used in the different steps including the equivalent assembly language mnemonics and microinstructions needed to execute the program. ALSO remember to hand in the answers to the following two questions.
  3. Add OR operation to the 8-bit CPU that we have learned.
    
            opcode# MNEMONIC                 DESCRIPTION
            ==============================================================
            00      XOR source, destination  XOR the contents of source,
                                             destination, and store the
                                             result in the destination
            --------------------------------------------------------------
            01      AND source, destination  AND the contents of source,
                                             destination, and store the
                                             result in the destination
            --------------------------------------------------------------
            10      NOT source, destination  invert the contents of
                                             source and store the result
                                             in destination
            --------------------------------------------------------------
            11      OR source, destination   OR the contents of source,
                                             destination,  and store the
                                             result in destination
            --------------------------------------------------------------
    
    
    
    Please note that the ALU will need two 8-bit operands input and produce the output of the ALU.
    Hand in a screen shot showing your new ALU in the 8-bit CPU circuit.

  4. Implement the following tasks with your enhanced 8-bit CPU, remember to pre-load the registers or memory when needed:
    
            1) Write out and hand in the microinstructions to perform this operation
    
               XOR #5,(C)
               including the machine code and how you load it to the memory.
    
               Pre-load the registers or memory when needed.
               For example:  Load 00001000  to the C register
                             Load 00000000  to the memory location 8
    
            2) Write out and hand in the microinstructions to perform the operation
    
               OR 5, 8
               including the machine code and how you load it to the memory.
    
               Pre-load the registers or memory when needed.
               For example:  Load 00000000  to the memory location 5
                             Load 00001010  to the memory location 8
    
            

Questions (hand in the answers)

 
	1) Describe the purpose of the 3->8 decoder. 

	2) Describe how the RAM chip control signals are used to read 
	   and write to memory. 



Copyright: Department of Computer Science, University of Regina.