Detecting ascending/descending 4-bit number

Discussion in 'Homework Help' started by VeloceT, Dec 11, 2010.

  1. VeloceT

    Thread Starter New Member

    Dec 11, 2010
    2
    0
    Hello,

    I need to build a device that accepts a 4-bit number and deciphers whether it's ascending, or descending (or both, such as 0000 or 1111.) The device has two outputs. The first gives 1 if and only if the number is ascending (each bit is greater than or equal to the bit to its left.), the other when it is descending.
    For example:
    0000
    0001
    0011
    0111
    1111

    are all examples for ascending numbers, whereas;

    0000
    1000
    1100
    1110
    1111

    are all descending. The rest are neither one.

    The design needs to include minimum number of logic gates!
    gates allowed (AND,OR,NAND,NOR,XOR).

    I have managed to create it using 12 gates. Can anyone come up with less?

    I would really be glad for help!
     
  2. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
    Can you post your work for it to be commented upon?
     
  3. tyblu

    Member

    Nov 29, 2010
    199
    16
    Try it with only NAND and NOR, as those are often the only ones available in CMOS circuits.
     
  4. VeloceT

    Thread Starter New Member

    Dec 11, 2010
    2
    0
    Here's my work (also all input/output)
    [​IMG]
    can you find a more efficient circuit to produce the exact same output?
     
Loading...