AR# 19554

|

6.2i ISE - I cannot find the HEX2LED code in the Project Navigator Language Templates

Description

Keywords: 7seg, display, hex, 7-segment

Urgency: Standard

General Description:
The Xilinx ISE 6 In-Depth Tutorial refers to the HEX2LED Converter code contained in the Verilog and VHDL Language Templates. I cannot find the templates in the specified location. You can access the Xilinx ISE 6 In-Depth Tutorial at:
http://www.xilinx.com/support/techsup/tutorials/tutorials6.htm

Solution

The Language Templates were significantly updated in the 6.2i release. Many of the templates, including HEX2LED, are located in a new sub-category. The previous location of the HEX2LED Converter was:
Verilog - Synthesis Templates - HEX2LED Converter
VHDL - Synthesis Templates - HEX2LED Converter

In 6.2i and later, the equivalent templates are available at:
Verilog - Synthesis Constructs - Coding Examples - Misc - 7-Segment Display Hex Conversion
VHDL - Synthesis Constructs - Coding Examples - Misc - 7-Segment Display Hex Conversion

The original Verilog template is provided below.

//HEX-to-seven-segment decoder
// input [3:0] HEX;
// output [6:0] LED;
// reg [6:0] LED;
//
// segment encoding
// 0
// __
// 5 | | 1
// ---- <- 6
// 4 | | 2
// ----
// 3

always @(HEX)
begin
case (HEX)
4'b0001 : LED = 7'b1111001; //1
4'b0010 : LED = 7'b0100100; //2
4'b0011 : LED = 7'b0110000; //3
4'b0100 : LED = 7'b0011001; //4
4'b0101 : LED = 7'b0010010; //5
4'b0110 : LED = 7'b0000010; //6
4'b0111 : LED = 7'b1111000; //7
4'b1000 : LED = 7'b0000000; //8
4'b1001 : LED = 7'b0010000; //9
4'b1010 : LED = 7'b0001000; //A
4'b1011 : LED = 7'b0000011; //b
4'b1100 : LED = 7'b1000110; //C
4'b1101 : LED = 7'b0100001; //d
4'b1110 : LED = 7'b0000110; //E
4'b1111 : LED = 7'b0001110; //F
default : LED = 7'b1000000; //0
endcase
end
AR# 19554
Date 03/20/2006
Status Archive
Type General Article
People Also Viewed