Could some electronics guru please help ? Suppose I want to mask a given byte with the test byte 10101010 . What would be the best way to achieve this - compare bit by bit with eight comparator, or AND ? Also, I am trying to do this at very high frequency - e.g. 5 - 10 GHz, so would an ordinary comparator have sufficient bandwidth ? Any hints, suggestions would be of immense value - thanks in advance.
What is the best way to implement masking ??
Oct 23, 2010
10 Replies
Depends on how your byte is transfered and if you need to change the mask. If you have 8 wires for transfering the byte and the mask is fixed, then the solution is to use your side cutter and cut the 4 wires which should be
0 and solder it to ground :-)
Frank Buss, http://www.frank-buss.de
piano and more: http://www.youtube.com/user/frankbuss
XOR ?
By 'mask' do you mean to AND the two bytes? The word 'comparator' was also used, do you intend to perform a magnitude-comparison operation (with outputs 'greater' 'equal' 'less')?
At 5 to 10 GHz, there will be significant problems with skew (the multiple wires that hold the eight bit values have propogation-time delays), and some kind of latching at known-valid-data times is usually required. That means your output value(s) will be valid only at some delayed time after the inputs arrive.
With what kind of technology do you intend to implement your system?
Failure does not prove something is impossible, failure simply
indicates you are not using the right tools...
nico@nctdevpuntnl (punt=.)
--------------------------------------------------------------
The Abacus should be serfice :)
Basically, I want to find out if the incoming bytes equal the mask - 10101010, so AND would appear to be the logical thing to do, but the result would be a byte, whose contents need to be examined to determine if the mask and the test byte are the same - sort of a recursive problem.
I totally agree with you. In fact right now the byte values get latched.
Ok, so equality.
Perform these operations: tmp(0..7)
If the mask pattern is fixed, put the inputs that are supposed to be "1" into a 4 input AND gate and those that are supposed to be "0" into a 4 input NOR gate and the output of those two gates into a 2 input AND gate.
If the mask pattern can be variable, use a XOR for each bit line and run the result to an eight input NOR gate to get a single indication of a match.
At least in old ECL families XOR was implemented with Gilbert cell style multipliers (three differential stages). Such multipliers are widely used in WLAN mixers at several GHz. Standard ECL voltage swing might be too much for such speeds.
Then you would have to figure out, how to implement the 8 input OR/NOR gate or when using the complementary (EQU) output from the XOR, how to make the 8 input AND/NAND gate.
On Oct 23, 8:02=A0am, Daku
Hi Daku - How about this :
formatting link
Output is '1' when input byte is '10101010' Any change in the input byte will set output to zero.
I would've thought the XOR would give you a better results. It would result in 0 for all 8 bits if ok, other wise, it would be a non zero..
"AND" will still need a operation to compare the value which is usually slower than just looking for a 0 or non zero state from a status flag that can operate a branch!.
what ever..
Jamie.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required