2013年11月30日 星期六

7 Segment Driver for Common Anode using Conditional Operator.v

// File        : 7 Segment Driver for Common Anode using Conditional Operator.v

module bcd_to_7segment_CA ( bcd ,seg7 );

output [6:0] seg7 ;

input [2:0] bcd ;


    assign seg7 = (bcd==0) ? 7'b0000001 :
            (bcd==1) ? 7'b1001111 :
            (bcd==2) ? 7'b0010010 :
            (bcd==3) ? 7'b0000110 :
            (bcd==4) ? 7'b1001100 :
            (bcd==5) ? 7'b0100100 :
            (bcd==6) ? 7'b1100000 :
            (bcd==7) ? 7'b0001111 :
            (bcd==8) ? 7'b0000000 :
            (bcd==9) ? 7'b0001100 :
            7'b1111111 ;

endmodule

沒有留言:

張貼留言

2026 作業1 MQTT基本觀念

 2026 作業1MQTT基本觀念 作業  參考下面網址 https://alex9ufoexploer.blogspot.com/2025/02/1-mqtt-relay-dht22-mqtt-box-pc-mymqtt.html https://alex9ufoexploer...