MATLAB DESIGN HDL CODER RELEASE NOTES Uživatelská příručka Strana 71

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 410
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 70
System Generator for DSP User Guide www.xilinx.com 71
UG640 (v 12.2) July 23, 2010
Compiling MATLAB into an FPGA
Example of disp Function
The following MCode function shows how to use the disp function to print variable
values.
function x = testdisp(a, b)
persistent dly, dly = xl_state(zeros(1, 8), a);
persistent rom, rom = xl_state([3, 2, 1, 0], a);
disp('Hello World!');
disp(['num2str(dly) is ', num2str(dly)]);
disp('disp(dly) is ');
disp(dly);
disp('disp(rom) is ');
disp(rom);
a2 = dly.back;
dly.push_front_pop_back(a);
x = a + b;
disp(['a = ', num2str(a), ', ', ...
'b = ', num2str(b), ', ', ...
'x = ', num2str(x)]);
disp(num2str(true));
disp('disp(10) is');
disp(10);
disp('disp(-10) is');
disp(-10);
disp('disp(a) is ');
disp(a);
disp('disp(a == b)');
disp(a==b);
The Enable print with disp option must be checked.
Zobrazit stránku 70
1 2 ... 66 67 68 69 70 71 72 73 74 75 76 ... 409 410

Komentáře k této Příručce

Žádné komentáře