xyuv = 4875
Design a 2-digit decimal up counter (xy->uv->xy) with external asynchronous reset (xyuv is the last 4 digits of your ID) ---example 00->99 counter LIBRARY ieee; USE ENTITY PORT END counter2: ARCHITECTURE BEGIN ieee.std_logic_1164.all; counter2 IS (clk, rst : IN digit1, digit2 OUT counter2 OF counter2 IS PROCESS (clk, rst) VARIABLE temp1: INTEGER RANGE O TO 10; VARIABLE temp2: INTEGER RANGE O TO 10; BEGIN -counter- IF (rst='1') THEN temp1 = 0; temp2 = 0; ELSIF (clk'EVENT AND clk='1') THEN temp1= temp1 + 1; IF (temp1=10) THEN END IF: STD_LOGIC; INTEGER RANGE O TO 9); END IF: digit1 <= temp1; digit2 <= temp2; END Process; END counter2: temp1 := 0; temp2= temp2 + 1; IF (temp2=10) THEN temp2 := 0; END IF:
xyuv = 4875
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am