登录站点

用户名

密码

两道数字设计题

4已有 1040 次阅读  2011-05-10 16:50
两道数字设计题
八音电子琴
要求:
1.能发出1、2、3、4、5、6、7、1 八个音;
2.用按键作为键盘;
3.C 调到B 调对应频率为:

TITLE "Top-level file for the 74151 macro.  Chooses a device-family optimized implementation.";
p74151 (c, b, a, d[7..0], gn) RETURNS (y, wn);
f74151 (c, b, a, d[7..0], gn) RETURNS (y, wn);

PARAMETERS
(
    DEVICE_FAMILY
);
INCLUDE "aglobal.inc";

SUBDESIGN 74151
(
    c                : INPUT = GND;
    b                : INPUT = GND;
    a                : INPUT = GND;
    d[7..0]          : INPUT = GND;
    gn               : INPUT = GND;
    y                : OUTPUT;
    wn               : OUTPUT;
)

VARIABLE
    IF (FAMILY_FLEX() == 1) GENERATE
        sub  : f74151;
    ELSE GENERATE
        sub  : p74151;
    END GENERATE;


用电器电源自动控制电路
要求:
1.控制电路能使用电器的电源自动开启30s,然后自动关闭30s,如此周而复始的工作,要有工作状态指示;
2.当电源接通时,可随时采用手动方式切断电源;当电源切断时,可随时采用手动方式接通电源;
3.若手动接通,可由定时信号断开,然后进入自动运行状态,反之亦然
4.定时范围0 分~60 分,要有分秒的倒计时显示。
module auto_power(clk,power_on,switch_on,switch_off,time_set,led,power_out,disp_m,disp_s);
input clk;
input power_on;
input switch_on;
input switch_off;
input[5:0] time_set;
output led;
output power_out;
output [5:0]disp_m;
output [5:0]disp_s;
reg    led;
reg    power_out;
reg    [5:0]disp_m;
reg    [5:0]disp_s;
reg    [4:0]count1;
reg    [2:0]stus;
reg    [5:0]temp1;
reg    [5:0]temp2;


parameter stus_on  =3'b000;
parameter stus_off =3'b001;
parameter stus_hon =3'b010;
parameter stus_hoff=3'b011;
parameter stus_null=3'b100;
parameter stus_honset =3'b101;
parameter stus_hoffset =3'b110;
parameter time_on  =5'd30;
parameter on       =1'b1;
parameter off      =1'b0;

上一篇: 互联网搜索碳排放量7克/次 新技术提速耗能低 下一篇: Protel DXP 快捷键大全2

分享 举报

发表评论 评论 (2 个评论)

涂鸦板