Create one 16-bit vector from two 8-bit vectors

user3263531

I want to create one 16-bit-vector from two 8-bit-vectors but have errors like below. How to solve it?

LIBRARY ieee;  
USE ieee.std_logic_1164.all;  
USE ieee.std_logic_arith.all;  

ENTITY Binary2Gray IS  
-- Declarations  
port(data : in  STD_LOGIC_VECTOR (3 downto 0);  
data_out : inout  STD_LOGIC_VECTOR (3 downto 0);  
data1 : inout std_logic_vector (1 downto 0);  
data2 : inout std_logic_vector (1 downto 0);  
CLK_I : in std_logic;  
y1 : out std_logic_vector (7 downto 0);   
y2 : out std_logic_vector (7 downto 0);  
op : out std_logic_vector (15 downto 0)  
);  
END Binary2Gray ;  

-----------------------------
ARCHITECTURE rtl OF Binary2Gray IS  

signal op : std_logic_vector (15 downto 0);  

begin  
    process(CLK_I)  
BEGIN  
data_out(3) <=data(3);  
data_out(2) <=data(3) xor data (2);  
data_out(1) <=data(2) xor data (1);  
data_out(0) <=data(1) xor data (0);  
label_1: for data_out in 0 to 3 loop  
    if(data_out = 0 ) then  
 data1(0) <=data(1) xor data (0);  
 elsif (data_out = 1 ) then  
    data1(1) <=data(2) xor data (1);  
elsif (data_out = 2 ) then  
    data2(0) <=data(3) xor data (2);  
else  
    data2(1) <=data(3);  
end if;  
end loop label_1;  
end process;  
with data1 select y1 <=  
"00110011" when "00",  
"00111101" when "01",  
"11010011" when "10",  
"11011101" when others;  
with data2 select y2 <=  
"00110011" when "00",  
"00111101" when "01",  
"11010011" when "10",  
"11011101" when others;  
op <= y1 & y2 ;  
 END rtl;   

Errors:

# Error: ELAB1_0008: QAM.vhd : (56, 8): Cannot read output : "y1".  
# Error: ELAB1_0008: QAM.vhd : (56, 8): Cannot read output : "y2".  
Morten Zilmer

In VHDL-2002 (and earlier) it is not allowed to read an output port like y1 and y2, hence the error.

Possible fixes are any of:

  • declared y1 and y2 as buffer ports
  • create intermediate signals y1_sig and y2_sig with the values and assign these to y1, y2, and op
  • use VHDL-2008 if possible in the tool chain.

Note that op should not be declared as signal when an output port. Note also that the process does probably not work as expected, since it is not a clocked process due to missing if rising_edge(CLK_I) then statement, nor a combinatorial process due to missing data in sensitivity list.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

VHDL - Adding two 8-bit vectors into a 9-bit vector

From Dev

Calculating 16-bit integer value from two 8-bit integers?

From Dev

Adding two 16 bit numbers using 8 bit registers (Assembly)

From Dev

Two 16 bit ints to One 32 bit float value

From Dev

Shuffle 16 bit vectors SSE

From Dev

How to Multiply 2 16 bit vectors and store result in 32 bit vector in sse?

From Dev

Multiply two vectors of 32bit integers, producing a vector of 32bit result elements

From Dev

Char size 8 bit or 16 bit?

From Dev

Linear PCM 16 bit to 8 bit

From Dev

how to add two 16-bit STD_LOGIC_VECTOR and a carry into 17-bit in VHDL?

From Dev

Can one use 4-bit, 8-bit, 16-bit, or 32-bit sized pointers on a 64-bit machine?

From Dev

How do I compute the 16-bit dot product of two arrays containing 8-bit values?

From Dev

Combine and convert two 16 bit numbers into one 32 bit number (float) in JavaScript

From Dev

Create a 16bit application?

From Dev

Create a 16bit application?

From Dev

Convert one 32bit float number into two 16bit uint number and then convert back to that 32bit float again

From Dev

How to select first 8 bit from bitset<16> in c++?

From Dev

Distance between two bit vectors in LISP

From Dev

How to Add signed 8-bit from unsigned 16-bit?

From Dev

How to Add signed 8-bit from unsigned 16-bit?

From Dev

Byte conversion from 32 bit to 8 bit

From Dev

Create list of vector pairs from all possible permutations of two vectors

From Dev

Create vector selecting values from two different vectors

From Dev

Convert Pixel Buffer to B8G8R8A8_UNorm from 16Bit

From Dev

How to Convert 32 bit float value to two 16 bit integers

From Dev

How does OpenCV imread convert between 16 bit and 8 bit

From Dev

compare 8bit value against 16bit value

From Dev

How to convert 8bit sound to 16bit

From Dev

Cannot move 8 bit address to 16 bit register

Related Related

  1. 1

    VHDL - Adding two 8-bit vectors into a 9-bit vector

  2. 2

    Calculating 16-bit integer value from two 8-bit integers?

  3. 3

    Adding two 16 bit numbers using 8 bit registers (Assembly)

  4. 4

    Two 16 bit ints to One 32 bit float value

  5. 5

    Shuffle 16 bit vectors SSE

  6. 6

    How to Multiply 2 16 bit vectors and store result in 32 bit vector in sse?

  7. 7

    Multiply two vectors of 32bit integers, producing a vector of 32bit result elements

  8. 8

    Char size 8 bit or 16 bit?

  9. 9

    Linear PCM 16 bit to 8 bit

  10. 10

    how to add two 16-bit STD_LOGIC_VECTOR and a carry into 17-bit in VHDL?

  11. 11

    Can one use 4-bit, 8-bit, 16-bit, or 32-bit sized pointers on a 64-bit machine?

  12. 12

    How do I compute the 16-bit dot product of two arrays containing 8-bit values?

  13. 13

    Combine and convert two 16 bit numbers into one 32 bit number (float) in JavaScript

  14. 14

    Create a 16bit application?

  15. 15

    Create a 16bit application?

  16. 16

    Convert one 32bit float number into two 16bit uint number and then convert back to that 32bit float again

  17. 17

    How to select first 8 bit from bitset<16> in c++?

  18. 18

    Distance between two bit vectors in LISP

  19. 19

    How to Add signed 8-bit from unsigned 16-bit?

  20. 20

    How to Add signed 8-bit from unsigned 16-bit?

  21. 21

    Byte conversion from 32 bit to 8 bit

  22. 22

    Create list of vector pairs from all possible permutations of two vectors

  23. 23

    Create vector selecting values from two different vectors

  24. 24

    Convert Pixel Buffer to B8G8R8A8_UNorm from 16Bit

  25. 25

    How to Convert 32 bit float value to two 16 bit integers

  26. 26

    How does OpenCV imread convert between 16 bit and 8 bit

  27. 27

    compare 8bit value against 16bit value

  28. 28

    How to convert 8bit sound to 16bit

  29. 29

    Cannot move 8 bit address to 16 bit register

HotTag

Archive