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

沒有留言:

張貼留言

ESP32 (ESP-IDF in VS Code) MFRC522 + MQTT + PYTHON TKinter +SQLite

 ESP32 (ESP-IDF in VS Code) MFRC522 + MQTT + PYTHON TKinter +SQLite  ESP32 VS Code 程式 ; PlatformIO Project Configuration File ; ;   Build op...