exxa
09-06-09, 20:59
Καλησπέρα είμαι καινούργιος στον προγραμματισμό και ειδικά στην γλώσσα vhdl.
Έχω να δημιουργήσω ένα πρόγραμμα ανακατανομής.
Δηλαδή τα bit που μπαίνουν να μπερδεύονται βάση ενός πίνακα και να βγαίνουν στην έξοδο.
Το πρόγραμμα που έχω γράψει είναι το εξής:
library ieee;
use ieee.std_logic_1164.all;
entity plaintext is
port ( x:in std_logic_vector (0 downto 127):0;
f:out std_logic_vector (0 downto 127):0;
end entity plaintext;
architecture ini_perm of plaintext is
begin
f(0) <= x(0); --Metathesi timon
f(1) <= x(32);
f(2) <= x(64);
f(3) <= x(96);
f(4) <= x(1);
f(5) <= x(33);
f(6) <= x(65);
f(7) <= x(97);
f(8) <= x(2);
f(9) <= x(34);
f(10) <= x(66);
f(11) <= x(98);
f(12) <= x(3);
f(13) <= x(35);
f(14) <= x(67);
f(15) <= x(99); ----
.......
end architecture ini_perm;
Δεν το συνεχίζω λόγω χώρου.
Και τα λάθει που εμφανίζει είναι :
-- Loading package standard
-- Loading package std_logic_1164
-- Compiling entity plaintext
** Warning: [3] C:/Modeltech_pe_edu_6.5b/examples/IP.vhd(5): (vcom-1246) Range 0 downto 127 is null.
** Warning: [3] C:/Modeltech_pe_edu_6.5b/examples/IP.vhd(6): (vcom-1246) Range 0 downto 127 is null.
-- Compiling architecture ini_perm of plaintext
** Error: C:/Modeltech_pe_edu_6.5b/examples/IP.vhd(11): (vcom-1152) Index value 0 is out of index range 0 downto 127 (null array) of ieee.std_logic_1164.std_logic_vector.
** Error: C:/Modeltech_pe_edu_6.5b/examples/IP.vhd(11): (vcom-1152) Index value 0 is out of index range 0 downto 127 (null array) of ieee.std_logic_1164.std_logic_vector.
Να σημειωθεί ότι το πρόγραμμα που χρησιμοποιώ για compile είναι το modelsim PE.
Πώς μπορώ να το διορθώσω??
Ευχαριστώ εκ τον προτέρων.
Έχω να δημιουργήσω ένα πρόγραμμα ανακατανομής.
Δηλαδή τα bit που μπαίνουν να μπερδεύονται βάση ενός πίνακα και να βγαίνουν στην έξοδο.
Το πρόγραμμα που έχω γράψει είναι το εξής:
library ieee;
use ieee.std_logic_1164.all;
entity plaintext is
port ( x:in std_logic_vector (0 downto 127):0;
f:out std_logic_vector (0 downto 127):0;
end entity plaintext;
architecture ini_perm of plaintext is
begin
f(0) <= x(0); --Metathesi timon
f(1) <= x(32);
f(2) <= x(64);
f(3) <= x(96);
f(4) <= x(1);
f(5) <= x(33);
f(6) <= x(65);
f(7) <= x(97);
f(8) <= x(2);
f(9) <= x(34);
f(10) <= x(66);
f(11) <= x(98);
f(12) <= x(3);
f(13) <= x(35);
f(14) <= x(67);
f(15) <= x(99); ----
.......
end architecture ini_perm;
Δεν το συνεχίζω λόγω χώρου.
Και τα λάθει που εμφανίζει είναι :
-- Loading package standard
-- Loading package std_logic_1164
-- Compiling entity plaintext
** Warning: [3] C:/Modeltech_pe_edu_6.5b/examples/IP.vhd(5): (vcom-1246) Range 0 downto 127 is null.
** Warning: [3] C:/Modeltech_pe_edu_6.5b/examples/IP.vhd(6): (vcom-1246) Range 0 downto 127 is null.
-- Compiling architecture ini_perm of plaintext
** Error: C:/Modeltech_pe_edu_6.5b/examples/IP.vhd(11): (vcom-1152) Index value 0 is out of index range 0 downto 127 (null array) of ieee.std_logic_1164.std_logic_vector.
** Error: C:/Modeltech_pe_edu_6.5b/examples/IP.vhd(11): (vcom-1152) Index value 0 is out of index range 0 downto 127 (null array) of ieee.std_logic_1164.std_logic_vector.
Να σημειωθεί ότι το πρόγραμμα που χρησιμοποιώ για compile είναι το modelsim PE.
Πώς μπορώ να το διορθώσω??
Ευχαριστώ εκ τον προτέρων.