IndiCore
Challenges
Courses
Playground
Leaderboard
Login
Confirm Logout
Are you sure you want to log out?
Combinational Logic
Gates and Small Circuits
Half Adder
Design a half adder circuit using Verilog. A half adder is a combinational circuit that computes the sum of two …
by Indicore
Solve
Full Adder
Design a full adder circuit using Verilog. A full adder adds a, b, and cin and outputs sum and cout.
by Indicore
Solve
Half Subtractor
Design a half subtractor which subtracts b from a and outputs diff and borrow.
by Indicore
Solve
Full Subtractor
Design a full subtractor that subtracts b and bin from a and outputs diff and bout.
by Indicore
Solve
2:1 Multiplexer
Design a 2:1 multiplexer using Verilog with inputs A, B, select S and output Y.
by Indicore
Solve
4:1 Multiplexer
Design a 4:1 Multiplexer circuit in Verilog.
by Indicore
Solve
1:2 DeMultiplexer
Design a 1:2 DeMultiplexer circuit in Verilog.
by Indicore
Solve
1:4 DeMultiplexer
Design a 1:4 DeMultiplexer circuit in Verilog.
by Indicore
Solve
2-bit Comparator
Design a 2-bit Comparator circuit in Verilog. It must have two inputs, a and b. After comparing, it must give …
by Indicore
Solve
4-bit Comparator
Design a 4-bit Comparator circuit in Verilog. It must have two inputs, a and b. After comparing, it must give …
by Indicore
Solve
Half Adder using MUX
Design a Half Adder using MUX circuit in Verilog. Use the pre-defined MUX in the user code, and assign appropriate …
by Indicore
Solve
Half Subtractor using MUX
Design a Half Subtractor using MUX circuit in Verilog.
by Indicore
Solve
Encoders & Decoders
2-to-4 Decoder
Design a 2-to-4 decoder. The output line corresponding to the input binary number should be high.
by Indicore
Solve
3-to-8 Decoder
Implement a 3-to-8 decoder that sets only one output bit high for each input combination.
by Indicore
Solve
4-to-2 Encoder (without priority)
Design a 4-to-2 encoder that produces a 2-bit binary code corresponding to which input is high.
by Indicore
Solve
8-to-3 Encoder (without priority)
Create an 8-to-3 encoder that outputs the binary code of the active input.
by Indicore
Solve
Priority Encoder (4-input)
Design a 4-input priority encoder where the highest-priority active input is encoded.
by Indicore
Solve
Code Converters
BCD to Excess-3 Converter
Design a combinational converter from a 4-bit BCD digit to its Excess-3 code. Excess-3 adds 3 to the BCD value, …
by Indicore
Solve
Excess-3 to BCD Converter
Design a combinational converter from a 4-bit Excess-3 code back to the BCD digit. Excess-3 is the BCD value plus …
by Indicore
Solve
Binary to BCD Converter
Convert an 8-bit unsigned binary number (0 to 255) into three BCD digits using the shift-and-add-3 (double dabble) algorithm: shift …
by Indicore
Solve
Binary to Gray Converter
Convert a 4-bit binary number to Gray code. The most significant Gray bit equals the binary MSB; every other Gray …
by Indicore
Solve
Gray to Binary Converter
Convert a 4-bit Gray code back to binary. The binary MSB equals the Gray MSB; each lower binary bit is …
by Indicore
Solve
Arithmetic Circuits
4-bit Ripple Carry Adder
Design a 4-bit ripple carry adder: four full adders chained so that the carry out of each bit feeds the …
by Indicore
Solve
4-bit Adder-Subtractor
Design a 4-bit adder-subtractor controlled by a single line: when sub is 0 the circuit computes a + b; when …
by Indicore
Solve
4-bit Carry Lookahead Adder
Design a 4-bit carry lookahead adder. Compute generate g = a & b and propagate p = a ^ b …
by Indicore
Solve
2's Complement Generator
Design a circuit that outputs the two's complement of a 4-bit input: invert every bit and add 1, which negates …
by Indicore
Solve
4-bit Binary Multiplier
Design an unsigned 4-bit by 4-bit multiplier producing an 8-bit product. A structural approach forms the four partial products (each …
by Indicore
Solve
Comparators and Detectors
Even Parity Generator
Generate an even parity bit for an 8-bit data word: parity is 1 when the data has an odd number …
by Indicore
Solve
Even Parity Checker
Check an 8-bit data word that arrived with an even parity bit. The error output is 1 when the nine …
by Indicore
Solve
Odd Parity Generator
Generate an odd parity bit for an 8-bit data word: parity is 1 when the data has an even number …
by Indicore
Solve
Bitwise Equality Comparator
Compare two 4-bit words bit by bit. eq[i] is 1 when a[i] equals b[i] (an XNOR per bit), and all_eq …
by Indicore
Solve
4-bit Magnitude Comparator (gates only)
Compare two unsigned 4-bit numbers using only logic gates (AND, OR, NOT, XOR): no relational operators. Work from the MSB …
by Indicore
Solve
Custom logic functions
Majority Detector (3-input and 5-input)
Write two modules. majority3 outputs 1 when at least two of its three inputs are 1. majority5 outputs 1 when …
by Indicore
Solve
Minority Detector (4-input)
Output 1 when the ones are in the minority among four inputs, i.e. when at most one of the four …
by Indicore
Solve
7-segment Display Decoder
Decode a BCD digit to the seven segments of a common-cathode display (segments light when their bit is 1). The …
by Indicore
Solve
5-input Voter
Five voters each cast a yes (1) or no (0). Output the number of yes votes and whether the motion …
by Indicore
Solve
Alarm System Logic
A home alarm has three sensors (door, window, motion) and two settings (armed, night). The alarm sounds only when the …
by Indicore
Solve
Logic Puzzles & Circuits
Logic Lock (4-bit key comparator)
A lock opens only when it is enabled and the entered key matches the stored code bit for bit. Inputs: …
by Indicore
Solve
Traffic Light Controller (combinational phase)
Given the current phase of a two-way junction, drive the north-south and east-west lights. Each light output is {red, yellow, …
by Indicore
Solve
4-bit Barrel Shifter
Rotate a 4-bit word by 0 to 3 positions in either direction. Rotation wraps the bits that fall off one …
by Indicore
Solve
Multiply by 2, 4 and 8 with shifts
Produce three products of an 8-bit unsigned input using left shifts: times2 = in << 1, times4 = in << …
by Indicore
Solve
Divide by 2, 4 and 8 with shifts
Produce three integer quotients of an 8-bit unsigned input using right shifts: div2 = in >> 1, div4 = in …
by Indicore
Solve
Bus and Priority Logic
2-device Priority Bus Arbiter
Two devices request a shared bus. Grant it to at most one of them: device 0 has priority, so when …
by Indicore
Solve
Tri-state Buffer Bus
Two 4-bit sources share one bus through tri-state buffers. When en_a is 1 the bus carries data_a; when en_b is …
by Indicore
Solve
Simple ALU (2-bit opcode)
A 4-bit ALU with four operations selected by a 2-bit opcode: 00 add, 01 subtract, 10 AND, 11 OR. Results …
by Indicore
Solve
ALU with AND, OR, XOR and ADD
A 4-bit ALU with a carry output: opcode 00 AND, 01 OR, 10 XOR, 11 ADD. cout is the carry …
by Indicore
Solve
Average of Two Numbers
Output the integer average of two unsigned 4-bit numbers: (a + b) / 2, rounding down. Add in 5 bits …
by Indicore
Solve
Data Routing
2x2 Crossbar Switch
Route two 4-bit inputs to two outputs. With sel = 0 the connection is straight (out0 = in0, out1 = …
by Indicore
Solve
Bit Reverser
Reverse the bit order of an 8-bit word: out[7] = in[0], out[6] = in[1], and so on, so 10100000 becomes …
by Indicore
Solve
Parity Bit Appender
Extend a 7-bit data word to 8 bits by appending an even parity bit as the new most significant bit, …
by Indicore
Solve
LED Pattern Generator
Drive eight LEDs with a pattern chosen by a 3-bit selector: 000 all off, 001 all on, 010 alternating 10101010, …
by Indicore
Solve
Parametrised Function Y = A.B + C.D
Implement y = (a AND b) OR (c AND d) bit by bit, for a bus width given by a …
by Indicore
Solve