TAMS / Java / Hades / applets: contents | previous | next | ||||
Hades Applets contents visual index introduction std_logic_1164 gatelevel circuits basic gates AND gates OR gates XOR and XNOR De Morgan complex gates AND12 gate simple decoder XOR variants 4-bit parity... 8-bit parity... 2x2 bit mult... Gray-code 7400 and 7486 seven-segmen... 7449 seven-s... Ascii decoder multiplexer ... multiplexer ... 74151 multip... 74154 decode... 74154 decode... priority enc... priority enc... Hamming code barrel-shifter delay models flipflops adders and arithm... 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 | Barrel-shifter (8 bit)
Circuit Description
This applet demonstrates a multiplexer-based 8-bit barrel-shifter.
The circuit allows shifting the input data word left,
where the amount of shifting is selected via the control inputs.
Several microprocessors include barrel-shifters as part of their ALUs
to provide fast shift (and rotate) operations.
The circuit shown in the applet consists of three stages of 2:1 multiplexers, with one multiplexer per bit of the input data (here 8). When all multiplexer select inputs are inactive (low), the input data passes straight through the cascade of the multiplexers and the output data (Q7..Q0) is equal to the input data (D7..D0). When enabled via the SHL_1 input, the first stage of multiplexers performs a shift-left by one bit operation, due the their interconnection to the next-lower input. A low input value (0) is used for the least significant bit, so that the shifter output becomes (Q6..Q1 0). Similarly, the second stage of multiplexers performs a shift-left by two bits when enabled via the SHL_2 control signal. Note that the corresponding multiplexer inputs are connected to their second next-lower input, and two zeroes are required for the lowest bits. Finally, the third stage of multiplexers performs a shift-left by four bits, with four zero bits filled into the lowest bits. Due to the cascade of three stages, all three shift operations (by one bit, by two bits, and by four bits) can be activated independently from each other. For example, when both SHL_1 and SHL_4 are activated, the shifter performs a shift-left by five bits. The generalization to higher word-width (e.g. 64 bits) and higher number of stages (e.g. 8) should be obvious, as should the construction of shift-right or rotate operators.
| |||
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/10-gates/60-barrel/shifter8.html |