control unit for cpu

Discussion in 'General Electronics Chat' started by vead, Oct 30, 2013.

  1. vead

    Thread Starter Active Member

    Nov 24, 2011
    621
    8
    I want to make control unit for 4 bit cpu I know control unit is made of many other circuit such as decoder ,multiplexer timer but I am confused which circuit make control unit for cpu

    1)how to decide which logic circuit is used to make control unit for cpu
    2)what circuit component I need to make control unit (i think basic gates)
    3) what should I need to know before to make control unit for cpu

    please anyone give me idea how to make control unit for cpu
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,414
    3,353
    What is a control unit for a CPU?

    The only answers to your questions I can suggest are:

    1) There is no single logic circuit.

    2) There is no circuit component. If you want to create a single chip solution you would have to use an FPGA.

    3) You need to study combinational and sequential logic design and finite state machines.
     
  3. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,669
    804
    A cpu IS the control unit. Maybe you meant controller for the ALU and data pathways.
     
  4. vead

    Thread Starter Active Member

    Nov 24, 2011
    621
    8
    I know combinational circuit make with the help of basic gates like encoder, decoder, multiplexer, demultiplexer these type of circuit make with basic gates like and not nor nand xor xnor

    sequential circuit make with the help of flip flop, latches like counter timer
    we use flip flop latches to make memory circuit

    cpu make with help of alu amd control unit
    i can make alu with basic gates to perform addition subtraction ......

    but my question is that how to make control unit for cpu or which circuits are used to make control unit if you want make control unit then first what things arise in your mind
     
    Last edited: Oct 30, 2013
  5. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    @vead
    Do you want to make CPU from discrete logic?
     
  6. BobTPH

    Active Member

    Jun 5, 2013
    782
    114
    The simplest control unit would be a simple alternating fetch / execute cycle. A single flip flop would determine which was active. On the fetch cycle, a word of program memory would be fetched into an internal register, and the PC incremented. On the execute cycle, the bits of the instruction word would determine what function would be performed, using decoders and multiplexers. You can get more complex, first by overlapping the two, them by addign more stages (a pipeline).

    Bob
     
  7. absf

    Senior Member

    Dec 29, 2010
    1,490
    371
    I have constructed a 4 bit TTL cpu with the help from the designer. His web site only gave the block diagram of his cpu. So after a few weeks of emails Q&A, I finally got the cpu working executing a simple program flashing some LEDs.

    His original design used 2 PAL chips and 5 TTL chips but in my design I used 15 TTL + 2716 EPROM and 2114 static RAM chips cause I dont have a PAL programmer. IIRC, the site was called "Mark's TTL microprocessor".

    The control unit was nothing more than just logic gates and a 74LS138 decoders.

    Allen
     
  8. vead

    Thread Starter Active Member

    Nov 24, 2011
    621
    8
    I think control unit is responsible for arithmetic logic. control unit inform to arithmetic logic what they should be perform what should be done in result
    cpu fetch and execute instruction so i think for fetching I need to encoder and multiplexer and for executing I need to decoder and demultiplexer and counter to count next step
     
  9. ScottWang

    Moderator

    Aug 23, 2012
    4,850
    767
    What's your ALU made from ?
    Are you using 74F181,74LS181 or just made from TTL ICs?

    [​IMG]
     
    Brian Griffin likes this.
  10. absf

    Senior Member

    Dec 29, 2010
    1,490
    371
    Nop, it doesnt has an dedicated ALU. The concept is very simple. It has an Accumulator, a 12 bit program counter able to address 4K memory , 16 nibble RAM and only 5 instructions.

    -sta store accumulator in RAM
    -lda load accumulator (RAM or immediate)
    -inc increment accumulator
    -jmp jmp to new location
    -cse skip next instruction if acc=data in RAM.

    There is no stack, no subroutine call and no arithmetic instructions. See the attached block diagram. There is no assembler as well. Every program has to be hand assembled and entered in binary.

    Allen
     
    Last edited: Oct 31, 2013
  11. ScottWang

    Moderator

    Aug 23, 2012
    4,850
    767
    What is Mag?
    What is IR? (instruction register?)
     
  12. absf

    Senior Member

    Dec 29, 2010
    1,490
    371
    "Mag" is magnitude comparator 74LS85 and yes, IR is Instruction register.

    As attached is the instruction set and the original Mark's design.

    Allen
     
    Last edited: Oct 31, 2013
Loading...