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.

Error (10500)

Status
Not open for further replies.

shahrilmajid

Newbie level 4
Joined
Nov 4, 2021
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
35
Can anyone help me? I am trying to use concurrent statements in this code. Is there anything wrong with ";" that I use in the code ?
Capture.PNG
Capture1.PNG
 

Not sure what’s wrong with your code; it might be that you’re using the WHEN-ELSE inside a process; I’ve never done that and don’t see a reason to. But I would use a CASE statement for your application.
 

Would you mind to post .vhd text instead of a screenshot, so we can check the actual code?

Error is to use conditional assignment (to be used in concurrent code) in a process (sequential code). Use a case construct or "if elsif else" instead.
 

Would you mind to post .vhd text instead of a screenshot, so we can check the actual code?
Code:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;

entity whenelse is
port (in_A, in_B : in std_logic_vector (7 downto 0);
     opcode : in std_logic_vector (1 downto 0);
     out_y : out std_logic_vector (7 downto 0);
     carry : out std_logic);
    end whenelse;
    
architecture beh of whenelse is
signal tmp    :    std_logic_vector(8 downto 0);
    begin
        process    (opcode)
            begin
            --start code
            tmp <=        ("0" & in_A) + ("0" & in_B)   when opcode = "00"   else
                        ("0" & in_A) - ("0" & in_B)   when opcode = "01"   else
                        ("0" & in_A) and ("0" & in_B) when opcode = "10"   else
                        ("0" & in_A) or ("0" & in_B)  when opcode = "11" ;
            end process;
out_y <= tmp (7 downto 0);
carry <= tmp (8);
end beh;
--- Updated ---

Would you mind to post .vhd text instead of a screenshot, so we can check the actual code?

Error is to use conditional assignment (to be used in concurrent code) in a process (sequential code). Use a case construct or "if elsif else" instead.
Is it possible for me to use concurrent assignment with "when" "else" statemen as in https://insights.sigasi.com/tech/signal-assignments-vhdl-withselect-whenelse-and-case/
 
Last edited:

Or simply remove the unneccessary process:

Code:
architecture beh of whenelse is
signal tmp    :    std_logic_vector(8 downto 0);
    begin
--        process    (opcode)
--            begin
            --start code
            tmp <=        ("0" & in_A) + ("0" & in_B)   when opcode = "00"   else
                        ("0" & in_A) - ("0" & in_B)   when opcode = "01"   else
                        ("0" & in_A) and ("0" & in_B) when opcode = "10"   else
                        ("0" & in_A) or ("0" & in_B)  when opcode = "11" ;
--            end process;
out_y <= tmp (7 downto 0);
carry <= tmp (8);
end beh;
 
Or simply remove the unneccessary process:

Code:
architecture beh of whenelse is
signal tmp    :    std_logic_vector(8 downto 0);
    begin
--        process    (opcode)
--            begin
            --start code
            tmp <=        ("0" & in_A) + ("0" & in_B)   when opcode = "00"   else
                        ("0" & in_A) - ("0" & in_B)   when opcode = "01"   else
                        ("0" & in_A) and ("0" & in_B) when opcode = "10"   else
                        ("0" & in_A) or ("0" & in_B)  when opcode = "11" ;
--            end process;
out_y <= tmp (7 downto 0);
carry <= tmp (8);
end beh;
Thank you. I learned something today from you today.
 

IIRC, Only Prime pro was getting 2008 updates. Prime lite is stuck with what they implemented over 10 years ago (which wasnt a lot).
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top