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.

"std_logic_vector" Related Questions

Status
Not open for further replies.

dzafar

Member level 4
Joined
Jan 17, 2017
Messages
76
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
690
I have three question!

Q1. Say:

signal X, Y: std_logic_vector (7 downto 0);
variable change_bit: std_logic;

change_bit = '0';

X <= "11100110";
Y <= X;

Y(6) <= change_bit; -- Is this valid? i.e. does Y now equal "10100110"?

Q2. Can we initialize an array using pre-defined attributes?

Say:

signal X: std_logic_vector (7 downto 0);
signal Y: X' range; -- is this valid? i.e. does this initialize Y to be (7 downto 0)?

Q3. What happens when:

signal X: std_logic_vector (7 downto 0);
signal X: std_logic_vector (3 downto 0);?
 

Q1. Say:

signal X, Y: std_logic_vector (7 downto 0);
variable change_bit: std_logic;

change_bit = '0';

X <= "11100110";
Y <= X;

Y(6) <= change_bit; -- Is this valid? i.e. does Y now equal "10100110"?
Variables can only exist in a process, so I will assume it was defined in a process.
Wrong assignment to the variable, it should be like this:
change_bit := '0';
Answer Q1: Yes it is valid.

Q2. Can we initialize an array using pre-defined attributes?

signal X: std_logic_vector (7 downto 0);
signal Y: X' range; -- is this valid? i.e. does this initialize Y to be (7 downto 0)? <<<<---------- WRONG
Where I have wrote WRONG, it should be like this:
signal Y: std_logic_vector(X'range); <<<---- THIS IS VALID

Q3. What happens when:

signal X: std_logic_vector (7 downto 0);
signal X: std_logic_vector (3 downto 0);?
ERROR, signal "X" has 2 definitions.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top