# systemc vector assignment

Status
Not open for further replies.

#### Vonn

##### Full Member level 4
Hi guys , i have a problem when I try to assign a value to bit victor in system c
my bit vector decleration is :
sc_in <sc_bv<8> > A,B;
and I tried to assign a value to this vector using the following statment
A = "01001000";
the compiler gives me a message
error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'char [9]' (or there is no acceptable conversion)

any body can help!

#### nand_gates

##### Advanced Member level 3
Hi,
With which systemC version you are working?? On what platform and OS you are
working??? Can you give example of ur systemC code here?? So that we can faithfully
reproduce the problem here on our side to help you out!

#### Vonn

##### Full Member level 4
sure thank you for your help
actually Iam using systemc-2.1.v1 under VC (visual studio 6) with windows OS

about my code, well it's a simple mux , and the problem is in the stim file below :

#include "systemc.h"

SC_MODULE(stim) {

sc_in <sc_bv<8> > A,B;
sc_in <bool> sel;
sc_in_clk CLK;

void stimgen() {

A = "01001000";
B = "00001111";
sel.write(false);
wait();

A="01001000";
B="00001111";
sel.write(true);
wait();

sc_stop();

}

SC_CTOR(stim)
{
SC_CTHREAD(stimgen,CLK.pos());
}

};

#### nand_gates

##### Advanced Member level 3
Do the following change in ur code and check!

Code:
sc_out <sc_bv<8> > A,B;
sc_out <bool> sel;

### Vonn

Points: 2
Helpful Answer Positive Rating

#### Vonn

##### Full Member level 4
I got the problem now It should be declared as output as you said ... thanx

Status
Not open for further replies.