Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to find number of one's in a vector in single clock

Status
Not open for further replies.

megastar007

Member level 4
Member level 4
Joined
Feb 20, 2007
Messages
71
Helped
10
Reputation
20
Reaction score
5
Trophy points
1,288
Location
Munich
Activity points
1,662
can any one tell me the circuit for finding number of 1's in a vector ..say 8 bit vector in a Single clock cycle. output should be 4 bits(bcos all 8 bits can be one)
 

An easy way is use a parallel eeprom. You can use the address as input data, and then data will be the result. You must program the eeprom with some like this:

This is an example to count just 4 bits, but for more bits is the same

Address Data
A3 A2 A1 A0 D2 D1 D0
0 0 0 0---->0 0 0
0 0 0 1---->0 0 1
0 0 1 0---->0 0 1
0 0 1 1---->0 1 0
0 1 0 0---->0 0 1
0 1 0 1---->0 1 0
0 1 1 0---->0 1 0
0 1 1 1---->0 1 1
1 0 0 0---->0 0 1
1 0 0 1---->0 1 0
1 0 1 0---->0 1 0
1 0 1 1---->0 1 1
1 1 0 0---->0 1 0
1 1 0 1---->0 1 1
1 1 1 0---->0 1 1
1 1 1 1---->1 0 0
 

Adder or LUT if the number of bits in the vector is small.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top