Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

VHDL code problem, need help ASAP !

Status
Not open for further replies.

alpha91

Full Member level 3
Full Member level 3
Joined
Sep 23, 2011
Messages
168
Helped
1
Reputation
2
Reaction score
2
Trophy points
1,298
Visit site
Activity points
2,625
Hi, i am doing the TEA in VHDL. but the coding for shift has some problem. can anyone tell me what to do?
it comes out with an error says that :
cant determine definition of operator '&' -- found 0 possible definition.
but actually in shift register code i did use the symbol '&' without any problem.

this is my code:

library ieee;
use ieee.std_logic_1164.all;
entity data is
port ( LI,RI: in bit_vector ( 6 downto 0); sub1, sub2, sub3, sub4,delta: in bit_vector (6 downto 0);C1: in bit; x,y:eek:ut bit);
end entity data ;

architecture logicvariable of data
is


signal s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20,s21,s22,s23,s24,s25,s26,s27,s28,s29,s30,s31,s32,s33,s34,s35,s36,s37,s38,s39,s50,s51,s52,s53,s54,s55,s56,s57,s58,s59,s60,s61,s62,s63,s64,s65 :bit;

begin

s50 <= RI( 1 downto 0) & "00000";
s51 <= "00000000";
s0 <= s50 xor s51; -- first group
s1 <= s0 xor RI xor C1;
s2 <= sub1 xor delta xor C1;
s3 <= s2 xor s1;
s4 <= LI xor s3 xor C1;

s52 <= s4 ( 1 downto 0) & "00000";
s53 <= "00000000";
s5 <= s52 xor s53 ; -- second group
s6 <= s5 xor s4 xor C1;
s7 <= sub2 xor delta xor C1;
s8 <= s7 xor s6;
s9 <= RI xor s8 xor C1;

s54 <= s9( 1 downto 0) & "00000";
s55 <= "00000000";
s10 <= s54 xor s55; -- third group
s11 <= s10 xor s9 xor C1;
s12 <= sub3 xor delta xor C1;
s13 <= s12 xor s11;
s14 <= s4 xor s13 xor C1;

s56 <= s14( 1 downto 0) & "00000";
s57 <= "00000000";
s15 <= s56 xor s57; -- forth group
s16 <= s15 xor s14 xor C1;
s17 <= sub4 xor delta xor C1;
s18 <= s17 xor s16;
s19<= s9 xor s18 xor C1;

s58 <= s19( 1 downto 0) & "00000";
s59 <= "00000000";
s20 <= s58 xor s59; -- fifth group
s21 <= s20 xor s19 xor C1;
s22 <= sub1 xor delta xor C1;
s23 <= s22 xor s21;
s24 <= s23 xor s14 xor C1;

s60 <= s24( 1 downto 0) & "00000";
s61 <= "00000000";
s25 <= s60 xor s61; -- sixth group
s26 <= s25 xor s24 xor C1;
s27 <= sub2 xor delta xor C1;
s28 <= s27 xor s26;
s29 <= s19 xor s28 xor C1;

s62 <= s29( 1 downto 0) & "00000";
s63 <= "00000000";
s30 <= s62 xor s63; -- seventh group
s31 <= s30 xor s29 xor C1;
s32 <= sub3 xor delta xor C1;
s33 <= s32 xor s31;
s34 <= s33 xor s24 xor C1;

s64 <= s34 (1 downto 0) & "00000"; -- eight group
s65 <= "00000000";
s35 <= s64 xor s65;
s36 <= s35 xor s34 xor C1;
s37 <= sub4 xor delta xor C1;
s38 <= s37 xor s36;
s39 <= s38 xor s34 xor C1;


x <= s34;
y <= s39;

end architecture logicvariable;

i just left this small part only. please... and thank you.


1.JPG
 
Last edited:

Hi,
Can you try it after by adding these VHDL libraries :
Code:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

Apart from the fact that std_logic_arith and std_logic_unsigned are not standard VHDL libraries, and hence should not be used in any new code, they will not help you here as the OPs code is all bit_vectors.

OP, you need to post the whole code - the code snippet is not enough. The picture hides the definition of s50 and s51.
 
Hi,
Can you try it after by adding these VHDL libraries :
Code:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;

hi, i sure not the problem with library, because last time i use this command with the same library without any problem.

Apart from the fact that std_logic_arith and std_logic_unsigned are not standard VHDL libraries, and hence should not be used in any new code, they will not help you here as the OPs code is all bit_vectors.

OP, you need to post the whole code - the code snippet is not enough. The picture hides the definition of s50 and s51.

the s50 and s51 is signal and i declared it in front already. my code is very very long. do you mind if i pm you my code ?
 

You need to show the full code, so we can see how s50 and s51 are declared.
Post the full code in the forum, inside code or syntax tags.
 

Editing existing posts is frowned upon btw.

- - - Updated - - -

the problem is that s50 and s51 are bits, not bit_vectors.
 

Editing existing posts is frowned upon btw.

- - - Updated - - -

the problem is that s50 and s51 are bits, not bit_vectors.

so what should i do? i cannot make the output as signal ? i need to shift the input.
 

There are many errors in the code.First decide data types of x and y,bit or bit_vector.
x <= s(34);
y <= s(39);
they give errors because s is not declared and indexing is out of range.may be they are
x<=s34;
y<=s39;
s1 <= s0 xor RI xor C1; change it to as like
s1 <= s0 xor RI xor ("000000" & C1);every where C1 is present.
 

so what should i do? i cannot make the output as signal ? i need to shift the input.

Use bit_vectors instead of just bit?

- - - Updated - - -

s1 <= s0 xor RI xor C1; change it to as like
s1 <= s0 xor RI xor ("000000" & C1);every where C1 is present.

This doesnt make any sense. You cannot xor single bits with a bit_vector.
 

@TrickyDicky I forgot to mention That is after changing every signal to bit_vector except C1.
 

@TrickyDicky I forgot to mention That is after changing every signal to bit_vector except C1.

So we are back to start: Show your code!

hi, the output x and y have been edited.

actually this is a code for TEA system. but i need to write it in data flow approach. and the & command doesnt work. it should be work because when i did shift register it did works without any error.
 

Im getting deja vu: You cannot do a shit register with single bits, as s50 and s51 are declared. You need to use a bit-vector, ie. an array of bits.
 

I dont know, how about actually assigning the output rather than just internal signals.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top