Shop OBEX P1 Docs P2 Docs Learn Events
8 bit or 16 bit comparator? — Parallax Forums

8 bit or 16 bit comparator?

ArchiverArchiver Posts: 46,084
edited 2000-11-10 14:27 in General Discussion
Is anyone aware if there is a 16 bit or 8 bit mag. comparator that
can be loaded via a serial line?

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-11-09 12:29
    I'm sorry if I was vague on my request. This what I'm trying to do... I
    have an encoder that feeds an up/down counter. I would like to to know
    whether or not I'm above or below or equal to a specific set point that is
    supplied by the stamp. All of the mag. comparators that I have found
    require 8 bits to be on the inputs, then you get a bit out for equal to or <
    >. This is fine and would work, but I do not want to tie up 8 i/o on the
    stamp that would supply one of the words (I believe 8 bits is a word?) that
    the comparator would use in its computation. So I thought maybe I could
    load a comparator via a serial link, by only using 3 i/o, therefore freeing
    up the rest of the I/O for other functions.

    Thankyou in advance for any help or advice on how to achieve this more
    efficiently.......Dan
    Original Message
    From: Bruce Bates <bvbates@u...>
    To: basicstamps@egroups.com <basicstamps@egroups.com>
    Date: Thursday, November 09, 2000 8:00 AM
    Subject: Re: [noparse][[/noparse]basicstamps] 8 bit or 16 bit comparator?


    >At 11/9/2000 12:02 PM, you wrote:
    >>Is anyone aware if there is a 16 bit or 8 bit mag. comparator that
    >>can be loaded via a serial line?
    >
    >If you would care to offer some more information - such as the application,
    >the answer MAY BE yes. Generally, magnitude comparators are parallel
    >devices, but it may be possible to use the serial mode of another device
    >which can do comparisons, but which whose general purpose is not as a
    >magnitude comparator.
    >
    >Regardless of what device is used, cascading is usually permissable; thus,
    >more than 8-bits can usually be compared by nn/8 units. Additionally, do
    >you need to know more than just EQUAL or NOT EQUAL, and is the data binary,
    >BCD, or some other format ?
    >
    >Regards,
    >
    >Bruce Bates
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-09 13:05
    At 11/9/2000 12:02 PM, you wrote:
    >Is anyone aware if there is a 16 bit or 8 bit mag. comparator that
    >can be loaded via a serial line?

    If you would care to offer some more information - such as the application,
    the answer MAY BE yes. Generally, magnitude comparators are parallel
    devices, but it may be possible to use the serial mode of another device
    which can do comparisons, but which whose general purpose is not as a
    magnitude comparator.

    Regardless of what device is used, cascading is usually permissable; thus,
    more than 8-bits can usually be compared by nn/8 units. Additionally, do
    you need to know more than just EQUAL or NOT EQUAL, and is the data binary,
    BCD, or some other format ?

    Regards,

    Bruce Bates
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-09 17:40
    Excerpts from Stamp_List: 9-Nov-100 [noparse][[/noparse]basicstamps] 8 bit or 16 b.. by
    mcruz1@t...
    > Is anyone aware if there is a 16 bit or 8 bit mag. comparator that
    > can be loaded via a serial line?

    There's a really elegant, simple solution, that works for n-bits, but
    this depends on how you get your serial input.

    If both numbers are being fed in at the same time, and the bits are
    syncronized, then all you need is a latch, and a flip-flop. here's how:

    take the number 1000 and 0000, read right to left, or lsb to msb,
    remember two bits of information as you traverse the bits.
    A: are the numbers not equal, this bit is reset to 0, and is set to 1
    by xor-ing the incoming bits. BUT this is also latched, once set to 1,
    it must stay 1. (until a new number starts coming in.)
    B: once A is set to 1, we know the numbers are not equal, now, we must
    compare the numbers. the input to flip-flop B would be the ouput of
    latch-A and input1 and not input2. this causes the flip-flop to be set
    to 1 if and only if input1 has a 1, and input 2 does not. So, flip-flop
    B will be a 1 if input 1 is greater.

    Please work through this logic. I'm rattling it off, and need to run to
    a meeting. but something along these lines will work. (may need more
    complex logic on flip-flop B, haven't convinced myself.)

    hope this helps,

    joshua
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-10 09:15
    At 07:29 AM 11/9/2000 -0500, you wrote:
    >I'm sorry if I was vague on my request. This what I'm trying to do... I
    >have an encoder that feeds an up/down counter. I would like to to know
    >whether or not I'm above or below or equal to a specific set point that is
    >supplied by the stamp. All of the mag. comparators that I have found
    >require 8 bits to be on the inputs, then you get a bit out for equal to or <
    > >. This is fine and would work, but I do not want to tie up 8 i/o on the
    >stamp that would supply one of the words (I believe 8 bits is a word?) that
    >the comparator would use in its computation. So I thought maybe I could
    >load a comparator via a serial link, by only using 3 i/o, therefore freeing
    >up the rest of the I/O for other functions.
    >
    > Thankyou in advance for any help or advice on how to achieve this more
    >efficiently.......Dan

    Dan -

    Probably the best bet is for me to contact you offlist, since any response
    at this point would be MANY PAGES long.
    We can summarize it, and re-post it back here, to be shared for all to see.

    Bruce Bates
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-10 13:26
    You can use a serial-in/parallel-out shift register as an interface between
    the stamp and the magnitude comparator. 3 wire I/O on the Stamp side, 8
    outputs on the comparator side.

    At 07:29 AM 11/9/00 -0500, you wrote:
    >I'm sorry if I was vague on my request. This what I'm trying to do... I
    >have an encoder that feeds an up/down counter. I would like to to know
    >whether or not I'm above or below or equal to a specific set point that is
    >supplied by the stamp. All of the mag. comparators that I have found
    >require 8 bits to be on the inputs, then you get a bit out for equal to or <
    >>. This is fine and would work, but I do not want to tie up 8 i/o on the
    >stamp that would supply one of the words (I believe 8 bits is a word?) that
    >the comparator would use in its computation. So I thought maybe I could
    >load a comparator via a serial link, by only using 3 i/o, therefore freeing
    >up the rest of the I/O for other functions.
    >
    > Thankyou in advance for any help or advice on how to achieve this more
    >efficiently.......Dan
    >
    Original Message
    >From: Bruce Bates <bvbates@u...>
    >To: basicstamps@egroups.com <basicstamps@egroups.com>
    >Date: Thursday, November 09, 2000 8:00 AM
    >Subject: Re: [noparse][[/noparse]basicstamps] 8 bit or 16 bit comparator?
    >
    >
    >>At 11/9/2000 12:02 PM, you wrote:
    >>>Is anyone aware if there is a 16 bit or 8 bit mag. comparator that
    >>>can be loaded via a serial line?
    >>
    >>If you would care to offer some more information - such as the application,
    >>the answer MAY BE yes. Generally, magnitude comparators are parallel
    >>devices, but it may be possible to use the serial mode of another device
    >>which can do comparisons, but which whose general purpose is not as a
    >>magnitude comparator.
    >>
    >>Regardless of what device is used, cascading is usually permissable; thus,
    >>more than 8-bits can usually be compared by nn/8 units. Additionally, do
    >>you need to know more than just EQUAL or NOT EQUAL, and is the data binary,
    >>BCD, or some other format ?
    >>
    >>Regards,
    >>
    >>Bruce Bates
    >>
    >>
    >>
    >>
    >>
    >
    >
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-11-10 14:27
    I'm not sure what your trying to do exactly, but if all you want to do is
    read the posistion of an incremental optical encoder and compare it to a
    value, I don't see why this would require a comparitor.

    It seems you could use a chip like the hewlett packard HCTL-2016 16 bit
    decoder/counter combo to read the posistion of the encoder. then compare
    the value using stamp math?





    At 08:26 AM 11/10/2000 -0500, you wrote:
    >You can use a serial-in/parallel-out shift register as an interface between
    >the stamp and the magnitude comparator. 3 wire I/O on the Stamp side, 8
    >outputs on the comparator side.
    >
    >At 07:29 AM 11/9/00 -0500, you wrote:
    >>I'm sorry if I was vague on my request. This what I'm trying to do... I
    >>have an encoder that feeds an up/down counter. I would like to to know
    >>whether or not I'm above or below or equal to a specific set point that is
    >>supplied by the stamp. All of the mag. comparators that I have found
    >>require 8 bits to be on the inputs, then you get a bit out for equal to or <
    >>>. This is fine and would work, but I do not want to tie up 8 i/o on the
    >>stamp that would supply one of the words (I believe 8 bits is a word?) that
    >>the comparator would use in its computation. So I thought maybe I could
    >>load a comparator via a serial link, by only using 3 i/o, therefore freeing
    >>up the rest of the I/O for other functions.
    >>
    >> Thankyou in advance for any help or advice on how to achieve this more
    >>efficiently.......Dan
    >>
    Original Message
    >>From: Bruce Bates <bvbates@u...>
    >>To: basicstamps@egroups.com <basicstamps@egroups.com>
    >>Date: Thursday, November 09, 2000 8:00 AM
    >>Subject: Re: [noparse][[/noparse]basicstamps] 8 bit or 16 bit comparator?
    >>
    >>
    >>>At 11/9/2000 12:02 PM, you wrote:
    >>>>Is anyone aware if there is a 16 bit or 8 bit mag. comparator that
    >>>>can be loaded via a serial line?
    >>>
    >>>If you would care to offer some more information - such as the application,
    >>>the answer MAY BE yes. Generally, magnitude comparators are parallel
    >>>devices, but it may be possible to use the serial mode of another device
    >>>which can do comparisons, but which whose general purpose is not as a
    >>>magnitude comparator.
    >>>
    >>>Regardless of what device is used, cascading is usually permissable; thus,
    >>>more than 8-bits can usually be compared by nn/8 units. Additionally, do
    >>>you need to know more than just EQUAL or NOT EQUAL, and is the data binary,
    >>>BCD, or some other format ?
    >>>
    >>>Regards,
    >>>
    >>>Bruce Bates
    >>>
    >>>
    >>>
    >>>
    >>>
    >>
    >>
    >>
    >>
    >>
    >>
    >
    >
    >
    >
Sign In or Register to comment.