Archived
1
0

Initial commit

This commit is contained in:
github-classroom[bot]
2024-02-23 13:01:05 +00:00
committed by GitHub
commit d212040c30
1914 changed files with 1290006 additions and 0 deletions

View File

@ -0,0 +1,38 @@
library ieee;
use ieee.math_real.all;
ARCHITECTURE test OF DAC_tester IS
constant clockPeriod: time := (1.0/clockFrequency) * 1 sec;
signal sClock: std_uLogic := '1';
signal sineFrequency: real := 20.0E3;
signal tReal: real := 0.0;
signal outAmplitude: real := 1.0;
signal outReal: real := 0.0;
signal outUnsigned: unsigned(parallelIn'range);
BEGIN
------------------------------------------------------------------------------
-- clock and reset
sClock <= not sClock after clockPeriod/2;
clock <= transport sClock after clockPeriod*9/10;
reset <= '1', '0' after 2*clockPeriod;
------------------------------------------------------------------------------
-- time signals
process(sClock)
begin
if rising_edge(sClock) then
tReal <= tReal + 1.0/clockFrequency;
end if;
end process;
outReal <= outAmplitude * ( sin(2.0*math_pi*sineFrequency*tReal) + 1.0) / 2.0;
outUnsigned <= to_unsigned(integer(outReal * real(2**(outUnsigned'length)-1)), outUnsigned'length);
parallelIn <= outUnsigned;
-- parallelIn <= shift_left(to_unsigned(1, parallelIn'length), parallelIn'length-1);
-- parallelIn <= shift_left(to_unsigned(3, parallelIn'length), parallelIn'length-2);
END ARCHITECTURE test;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,3 @@
DEFAULT_FILE atom @d@a@c_tb/struct.bd
DEFAULT_ARCHITECTURE atom struct
TOP_MARKER atom 1

View File

@ -0,0 +1,2 @@
DEFAULT_ARCHITECTURE atom test
DEFAULT_FILE atom DAC_tester_test.vhd