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.

VERILOG CODE FOR BCD TO DECODER????

Status
Not open for further replies.

dogarsahab

Newbie level 1
Joined
May 26, 2008
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,286
bcd verilog code

I am having problem in writing the verilog code for BCD to decoder and display the digit on LED..
I am not finding any way how to start with???
please help me out!!!!
 

vhdl code for bcd to decimal decoder

I think you mean a BCD-to-7-segment decoder.

Here is the 'case' statement from a digital clock project that I wrote some time ago. Maybe it will help you.

'nibble' is the 4-bit input code (similar to your BCD value), and 'segment' is an 8-bit register connected to the 7-segment display (and its unused decimal point). It displays hex digits 0 through F. For example, when nibble is 3, it illuminates segments a b c d g.
Code:
    case (nibble)
       0: segment <= ~8'b11111100;  // "a b c d e f g h"
       1: segment <= ~8'b01100000;
       2: segment <= ~8'b11011010;  //   --a--
       3: segment <= ~8'b11110010;  //  |     |
       4: segment <= ~8'b01100110;  //  f     b
       5: segment <= ~8'b10110110;  //  |     |
       6: segment <= ~8'b10111110;  //   --g--
       7: segment <= ~8'b11100000;  //  |     |
       8: segment <= ~8'b11111110;  //  e     c
       9: segment <= ~8'b11100110;  //  |     |
      10: segment <= ~8'b11101110;  //   --d--  (h)
      11: segment <= ~8'b00111110;
      12: segment <= ~8'b10011100;
      13: segment <= ~8'b01111010;
      14: segment <= ~8'b10011110;
      15: segment <= ~8'b10001110;
      default: segment <= 8'bx;
    endcase
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top