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

沒有留言:

張貼留言

2024產專班 作業2 (純模擬)

2024產專班 作業2  (純模擬) 1) LED ON,OFF,TIMER,FLASH 模擬 (switch 控制) 2)RFID卡號模擬 (buttom  模擬RFID UID(不從ESP32) 3) 使用database需先create建立資料庫 Node-Red 程式 [...