cours2: nosign_extend_32.h

File nosign_extend_32.h, 366 bytes (added by fpecheux, 15 years ago)
Line 
1#ifndef _NOSIGN_EXTEND_32_H
2#define _NOSIGN_EXTEND_32_H
3#include "systemc.h"
4
5SC_MODULE(nosign_extend_32)
6{
7        sc_in<sc_uint<16> > I;
8        sc_out<sc_uint<32> > O;
9
10        SC_CTOR(nosign_extend_32)
11        {
12                SC_METHOD(mWrite);
13                sensitive << I ;
14        }
15
16        void mWrite()
17        {
18                sc_uint<16> i_value=I.read();
19
20                O.write(0x00000000 | i_value.range(15,0));
21        }
22};
23#endif
24