Professional Documents
Culture Documents
Synthesize-able Designs
Day –10,11
process(skeyhit)
begin
if( rising_edge(skeyhit)) then
lkeyscn <= skeyscn;
lkeyret <= pkeyret;
end if;
end process;
begin
if(falling_edge(sdspclk) ) then
vdspseq := vdspseq+1;
end if;
if(falling_edge(sdspclk) ) then
if(vdspseq > 3) then
vdspnum := vdspnum+1;
end if;
end if
if(vdspseq < 4) then
plcddat <= tlcddat(vdspseq);
vdspnum := 0;
else
plcddat <= tlcddat(vdspseq);
tchr1 <= mystr(vdspnum);
plcddat <= std_logic_vector(to_unsigned(character'pos(tchr1),8));
end if;
plcdrw <= '0';
if(vdspseq < 4) then
plcdrs <= '0';
else
plcdrs <= '1';
end if;
end process; STC on HDL for Digital System Design 8
Interfacing Seven Segment Display
begin
if(sdspmux = "1110") then pdspseg <= segval(sdspnum);
elsif(sdspmux = "1101") then pdspseg <= segval(sdspnum+1);
elsif(sdspmux = "1011") then pdspseg <= segval(sdspnum+2);
elsif(sdspmux = "0111") then pdspseg <= segval(sdspnum+3);
else pdspseg <= "0000000";
end if;
end process;
process(sstpcnt)
begin
if (sstpcnt = "00") then pstpsig <= "0001";
elsif(sstpcnt = "01") then pstpsig <= "0111";
elsif(sstpcnt = "10") then pstpsig <= "1110";
elsif(sstpcnt = "11") then pstpsig <= "1000";
end if;
end process;