views:

44

answers:

2

Does System C support tri-state logic? That is, bits that can get 0, 1 or X, where X means "unknown"?

If it does, does it also support vectors that can contain Xes, including logic and arithmetic operations?

+1  A: 

Here is what you need:

It does not have tri-state variables, but quad-state (is that correct? :P) variables (0,1,X,Z). More about it in the above links. It also supports vectors of those variables.

Hope I helped you a little bit :)

George B.
A: 

Yeah, you're looking for the sc_logic and sc_lv types which are 4 state variables: 0, 1, X, and Z. Pay attention to how they interact when you resolve them together. There's a nice tables on the asic-world.com site taken directly from the SystemC User Manual.

Note though that this doesn't work like in Verilog where X can also act as a wildcard. I had to build my own function to add that functionality.

spellman23