Author Topic: 4-bit leading one detector?  (Read 10940 times)

0 Members and 1 Guest are viewing this topic.

Offline tiofilo75Topic starter

  • Contributor
  • Posts: 37
4-bit leading one detector?
« on: June 23, 2012, 11:22:17 pm »
Hello everyone. This is my first post. I am currently going to school and am having some trouble understanding one of my assignments. I have tried Google but I am still confused. So I am suppose to come up with a Boolean function that detects the leading ones in 4 bits. Can some one please shed me some light?

I know about kmaps, I just dont know how fill up the rest of the truth table. What exactly is a "leading one detector"? What exactly are my Z , L1 and L2 outputs?

Ok, I figured out that the L1 and L2 give the position of the leading 1 in binary. I just need to figure out what Z is.
« Last Edit: June 23, 2012, 11:57:28 pm by tiofilo75 »
 

Offline chrome

  • Regular Contributor
  • *
  • Posts: 185
  • Country: be
Re: 4-bit leading one detector?
« Reply #1 on: June 23, 2012, 11:32:02 pm »
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nz
Re: 4-bit leading one detector?
« Reply #2 on: June 23, 2012, 11:57:41 pm »
A leading one detector just provides the position of the first 1.
The word "leading" indicates your looking for the first one starting from the MSB and moving right towards LSB.
(A trailing one detector would look for the first 1 starting at LSB moving left to MSB)

So, using the existing middle line of the truth table as an example

B3 B2 B1 B0
0   1    1   1

Starting from the MSB, B3 (0) and looking for the first one we find it in the B2 position.
B2 = 2 which is 10 in binary, so (L1=1 L0=0)
« Last Edit: June 24, 2012, 12:10:46 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline olsenn

  • Frequent Contributor
  • **
  • Posts: 993
Re: 4-bit leading one detector?
« Reply #3 on: June 24, 2012, 12:01:43 am »
It looks to me like what this system is described by the following relationship:

        If B0, B1, B2, and B3 are 0, Z=1, and L1/L2 don't matter. Otherwise, Z=0
        If Z=0, the number L1L0 = the most significant bit that is 1

So when B3 B2 B1 B0 == 0 0 0 1, B0 is the MSB that is 1, so L1 L0 == 0 0 (0 in decimal)
     when B3 B2 B1 B0 == 0 1 1 1, B2 is the MSB that is 1, so L1 L0 == 1 0 (2 in decimal)
     when B3 B2 B1 B0 == 1 1 1 0, B3 is the MSB that is 1, so L1 L0 == 1 1 (3 in decimal)
     when B3 B2 B1 B0 == 1 1 1 1, B3 is the MSB that is 1, so L1 L0 == 1 1 (3 in decimal)

... In theory, if B3 B2 B1 B0 == 0 0 1 0, or 0 0 1 1, B1 would be the MSB that is 1, so L1 L0 would be 0 1 (1 in decimal)


Hope this helps!
             
 

Offline Tony R

  • Regular Contributor
  • *
  • Posts: 117
  • Country: 00
Re: 4-bit leading one detector?
« Reply #4 on: June 25, 2012, 11:37:57 am »
If we did this for you you would not learn...

so this here are some tips

1) complete the truth table with all 16 values. (by observing the truth table the L1 and L2 are your most significant one.) and z means zero.

0001 => 00
001x => 01
01xx => 02
1xxx => 03

now that I think about it it is a lot like a priority encoder.

2) Separate it out into 3 separate tables one for Z, L1 and L2 and then do the simplification.
Tony R.
Computer Engineering Student
Focus: Embedded Assembly Programming, Realtime Systems,  IEEE Student Member
 

Offline tiofilo75Topic starter

  • Contributor
  • Posts: 37
Re: 4-bit leading one detector?
« Reply #5 on: June 26, 2012, 04:25:25 am »
 I was able to figure it out. Thanks for the help everyone. :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf