TAMS / Java / Hades / applets: contents | previous | next | ||||
Hades Applets contents visual index introduction std_logic_1164 gatelevel circuits delay models flipflops adders and arithm... half-adder a... ripple-carry... BCD adder carry-select... CLA adder (8... CLA adder (1... CLA generator CLA adder block CLA adder, slow adder/subtra... 7485 comparator 7485 comparator 74181 ALU de... 74181 ALU ci... 74181+74182 ... 74182 CLA ge... Hamming-weight Hamming-weig... integer mult... square calcu... square root ... carry-save a... CSA based mu... counters LFSR and selftest memories programmable logic state-machine editor misc. demos I/O and displays DCF-77 clock relays (switch-le... CMOS circuits (sw... RTLIB logic RTLIB registers Prima processor D*CORE MicroJava Pic16 cosimulation Mips R3000 cosimu... Intel MCS4 (i4004) image processing ... [Sch04] Codeumsetzer [Sch04] Addierer [Sch04] Flipflops [Sch04] Schaltwerke [Sch04] RALU, Min... [Fer05] State-Mac... [Fer05] PIC16F84/... [Fer05] Miscellan... [Fer05] Femtojava FreeTTS | Hamming weight (12 bit adder tree)
Circuit Description
This circuit counts the number of active (1) bits in the input word
(also known as the Hamming weight).
Obviously, a single full-adder can be used to calculate the
Hamming weight of a three bit input word.
For larger input word width,
a tree of adders can be used
to combine the intermediate sums from the previous stages.
Click the input switches or type the '0'..'9' and 'a', 'b' bindkeys to play with the circuit. See the next applet for an animated demonstration of the Hamming weight adder-tree. To keep the circuit layout readable, the carry-in inputs of the multi-bit adders are tied to GND (logical 0) in the example. Naturally, these carry-in inputs could be connected to additional input pins, which would allow for 15-bits of input with the same number of adders. As 15 is also the highest number that one three-bit adder can generate, a 16-bit bitcounter would obviously require another adder, etc.
| |||
Print version | Run this demo in the Hades editor (via Java WebStart) | ||||
Usage | FAQ | About | License | Feedback | Tutorial (PDF) | Referenzkarte (PDF, in German) | ||||
Impressum | http://tams.informatik.uni-hamburg.de/applets/hades/webdemos/20-arithmetic/80-bitcount/bitcount.html |