zczx

library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;

entity clock60 is
    port(
        CLK : in std_logic;    --clear
        CLR : in std_logic;    --clock
        s1 : out std_logic_vector(3 downto 0);    --1
        s10 : out std_logic_vector(3 downto 0);    --10
        c0 : out std_logic    --adder of it
    );
end clock60;

architecture art of clock60 is
    signal tmp1 : std_logic_vector(3 downto 0);
    signal tmp10 : std_logic_vector(2 downto 0);
begin
    process(CLK, CLR)
    begin
        if(CLR = ‘1‘) then
            tmp1 <= "0000";
            tmp10 <= "000";
        elsif(CLK‘event and CLK=‘1‘) then
            if(tmp1 = 9) then
                tmp1 <= "0000";
                if(tmp10 = 5) then tmp10 <= "000";
                else tmp10 <= tmp10 + 1;
                end if;
            else tmp1 <= tmp1 + 1;
            end if;
        end if;
    end process;
    s1 <= tmp1;
    s10 <= tmp10;
    c0 <= ‘1‘ when(tmp10 = 5 and tmp1 = 9)
    else ‘0‘;
end art;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity window is
port(
    I:    in std_logic_vector(3 downto 0);
    A:    out std_logic_vector(6 downto 0)
);
end window;

architecture art of window is
begin
    with I select
        A <="1111110" when "0000",
            "0001100" when "0001",
            "1101101" when "0010",
            "1111001" when "0011",
            "0110011" when "0100",
            "1011011" when "0101",
            "0011111" when "0110",
            "1110000" when "0111",
            "1111111" when "1000",
            "1110011" when "1001",
            "0000000" when others;
end art;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity trai is
port(
    I, G : in std_logic;
    Aout: out std_logic
);
end trai;

architecture art of trai is
begin
    process(I,G)
    begin
        if(G = ‘0‘) then Aout <= I;
        else Aout <= ‘Z‘;
        end if;
    end process;
end art;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity prec is
port(
    I:    in std_logic_vector(1 downto 0);
    A:    out std_logic_vector(3 downto 0)
);
end prec;

architecture art of prec is
begin
    with I select
        A <="1110" when "00",
            "1101" when "01",
            "1011" when "10",
            "0111" when others;
end art;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity selecter is
port(
    I, R:    in std_logic_vector(3 downto 0);
    Aout:    out std_logic
);
end selecter;

architecture art of selecter is
begin
    Aout <= R(0) when I = "1110" else
            R(1) when I = "1101" else
            R(2) when I = "1011" else
            R(3) when I = "0111" else
            ‘0‘;
end art;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;

entity sour is
port(
    CLK:    in std_logic;
    CLK2:    out std_logic
);
end sour;

architecture art of sour is
    signal tmp : std_logic_vector(9 downto 0);
begin
    process(CLK)
    begin
        if(tmp = 999) then tmp <= "0000000000";
        else tmp <= tmp + 1;
        end if;
    end process;
    CLK2 <= ‘1‘ when tmp = 999 else ‘0‘;
end art;
时间: 2024-12-20 18:39:25

zczx的相关文章

awk,systemctl,破解7root口令

awk -F 指明输入时用到的字段分隔符 默认空格为分隔符 -v 自定义变量 基本格式:awk [options] 'program' file $1,$2..$n称为域标识,$0为所有域. 文件的每一行称为记录 awk '{print}' /etc/passwd 默认 print $0 显示全段 awk 'BEGIN{print "hello,awd"}' awk '{print "hello,awd"}' 支持输入 df |awk '{print $5}' df

mount挂载,dd 工具,配置配额系统,RAID阵列,逻辑卷管理器LVM

mount mount挂载 vim /etc/fstab 将常用的挂载的设备写入系统表中 文件挂载配置文件 /etc/fstab /etc/fstab每行定义一个要挂载的文件系统: 要挂载的设备或伪文件系统 挂载点 文件系统类型 挂载选项 转储频率 自检次序 要挂载的设备或伪文件系统: 设备文件.LABEL(LABEL="").UUID(UUID="").伪文件系统名称(proc, sysfs) 挂载选项:defaults 转储频率:0:不做备份 每天转储 每隔一天

Linux 的shell脚本编程

shell脚本编程 程序:指令+数据 程序编辑风格:             过程式:以指令为中心,数据服务于指令             对象式:以数据为中心,指令服务于数据 shell程序:提供了编程能力,解释执行 计算机:运行二进制指令 编程语言: 低级:汇编语言 高级:编译:高级语言-->编译器-->目标代码 java,c#,c,c++ 解释:高级语言-->解释器-->机器代码 shell,per,python 编程逻辑处理方式:           顺序执行      

magedu Linux运维学习的第二天

回显,回声 echo echo hello > /dve/pts/1 打开图形界面 init 5 关闭图形界面 init 3 ctrl+alt+F1-6字符,F7图形界面 chvt 改变虚拟终端 chvt +数字 startx  图形的软件打开 poweroff centOS 6.8与7.2都正常关闭断电 hostname 显示主机的名字 lsb_release -a  显示centOS 版本 cat /etc/redhat-release cat /etc/centos-release nan

基础指令的使用篇3 Linux版

/ /boot /bin /sbin /lib.modules /lib64 /etc/redhat-release /etc/centos-release /home/zczx /mnt /media /misc /proc/meminfo /proc/cpuinfo /proc/partition /sya /opt /tmp /usr/local/ /usr/share/man /usr/share/doc /usr/share/dict /var/log/ /var/www /var/f

Linux &nbsp; 用户组和用户权限的使用2

touch /etc/nologin echo system is maintanining >> /etc/nologin 可以控制非管理员root之外的所有普通用户不能登陆 7版本里面 cd /run/ touch /run/nologin 效果一样让普通用户不能登陆 ehho weihu > /run/nologin useradd -ou0 root2 通过强制该成UID=0 生成管理员用户 cp -r /etc/skel/. /home/zczx cp -r /etc/skl/

Linux &nbsp; 用户,组和用户权限的使用

echo -e "Hello,I am 'whoami',the system version is here,please helcheck ist  thanks! \n'lsb_release'"| mail -s 'help'root cmd1 |cmd 2 cma1 2>&1 | cmd2 cmd1 | & cmd2 tr 转换和删除字符 tr'a-z' 'A-Z' abc ABC echo abc |tr 'a-z' 'A-Z' | tr 'A-Z'