BitFlow

7-Segment Display Decoder

beginner · combinational · 60 XP

Sign in to write your solution, run it in the simulator and submit it for grading.

Sign in or create a free account →

Problem

7-Segment Display Decoder Input: 4-bit BCD digit `bcd[3:0]` (values 0–9). Output: 7-bit `seg[6:0]` encoding the segments for a **common-anode** display. Segment mapping (active-low: 0 = segment ON): ``` aaa f b f b ggg e c e c ddd ``` `seg = {a, b, c, d, e, f, g}` | Digit | seg[6:0] | Display | |-------|----------|---------| | 0 | 7'b000_0001 | 0 | | 1 | 7'b100_1111 | 1 | | 2 | 7'b001_0010 | 2 | | 3 | 7'b000_0110 | 3 | | 4 | 7'b100_1100 | 4 | | 5 | 7'b010_0100 | 5 | | 6 | 7'b010_0000 | 6 | | 7 | 7'b000_1111 | 7 | | 8 | 7'b000_0000 | 8 | | 9 | 7'b000_0100 | 9 | | 10–15 | 7'b111_1110 | dash (—) | Invalid inputs 10–15 display a dash (only segment g active).

Constraints

  • Use a case statement inside always @(*).
  • Default case must output dash: 7'b111_1110.

Examples

Input: bcd=4'd0

Output: seg=7'b000_0001

Input: bcd=4'd15

Output: seg=7'b111_1110 (dash)

Common questions

What does the 7-Segment Display Decoder problem ask you to build?
7-Segment Display Decoder Input: 4-bit BCD digit `bcd[3:0]` (values 0–9). Output: 7-bit `seg[6:0]` encoding the segments for a **common-anode** display.
What constraints does 7-Segment Display Decoder have?
Use a case statement inside always @(*).; Default case must output dash: 7'b111_1110.
What is an example input and output for 7-Segment Display Decoder?
Input bcd=4'd0 gives output seg=7'b000_0001.
Which Verilog concepts does 7-Segment Display Decoder practise?
combinational, decoder, BCD, case, display.