OpenCores
URL https://opencores.org/ocsvn/scarm/scarm/trunk

Subversion Repositories scarm

[/] [scarm/] [trunk/] [src/] [scSignExt.cpp] - Blame information for rev 10

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 5 zhong
// scSignExt.cpp: implementation of the scSignExt class.
2
/*                            -------------------
3
    begin                : Oct 2 2002
4
    copyright            : (C) 2002 UESTC
5
    author               : Zhong Tao
6
    email                : zhong@opencores.org
7
 ***************************************************************************/
8
 
9
/***************************************************************************
10
 *                                                                         *
11
 *   This program is free software; you can redistribute it and/or modify  *
12
 *   it under the terms of the GNU General Public License as published by  *
13
 *   the Free Software Foundation; either version 2 of the License, or     *
14
 *   (at your option) any later version.                                   *
15
 *                                                                         *
16
 ***************************************************************************/
17
#include "scSignExt.h"
18
 
19
//////////////////////////////////////////////////////////////////////
20
// Construction/Destruction
21
//////////////////////////////////////////////////////////////////////
22
 
23
scSignExt::scSignExt(sc_module_name name_):sc_module(name_)
24
{
25
  SC_METHOD(entry);
26
  sensitive<<in_Data;
27
}
28
 
29
scSignExt::~scSignExt()
30
{
31
 
32
}
33
 
34
void scSignExt::entry()
35
{
36
 
37
  //24bit  offset Sign extension
38
  uint32_t temp=in_Data;
39
  if(temp&(0x00800000))
40
  {
41
     temp=(temp|0xFF000000);
42
 
43
  }
44
  out_Data=temp;
45
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.