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

Subversion Repositories zipcpu

[/] [zipcpu/] [trunk/] [sim/] [cpp/] [twoc.h] - Blame information for rev 209

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 209 dgisselq
////////////////////////////////////////////////////////////////////////////////
2 204 dgisselq
//
3
// Filename:    twoc.h
4
//
5 209 dgisselq
// Project:     Zip CPU -- a small, lightweight, RISC CPU soft core
6 204 dgisselq
//
7
// Purpose:     Some various two's complement related C++ helper routines.
8
//              Specifically, these help extract signed numbers from
9
//              packed bitfields, while guaranteeing that the upper bits
10
//              are properly sign extended (or not) as desired.
11
//
12
// Creator:     Dan Gisselquist, Ph.D.
13
//              Gisselquist Technology, LLC
14
//
15 209 dgisselq
////////////////////////////////////////////////////////////////////////////////
16 204 dgisselq
//
17 209 dgisselq
// Copyright (C) 2015,2017, Gisselquist Technology, LLC
18 204 dgisselq
//
19
// This program is free software (firmware): you can redistribute it and/or
20
// modify it under the terms of  the GNU General Public License as published
21
// by the Free Software Foundation, either version 3 of the License, or (at
22
// your option) any later version.
23
//
24
// This program is distributed in the hope that it will be useful, but WITHOUT
25
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
26
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
27
// for more details.
28
//
29
// You should have received a copy of the GNU General Public License along
30 209 dgisselq
// with this program.  (It's in the $(ROOT)/doc directory.  Run make with no
31 204 dgisselq
// target there if the PDF file isn't present.)  If not, see
32
// <http://www.gnu.org/licenses/> for a copy.
33
//
34
// License:     GPL, v3, as defined and found on www.gnu.org,
35
//              http://www.gnu.org/licenses/gpl.html
36
//
37
//
38 209 dgisselq
////////////////////////////////////////////////////////////////////////////////
39
//
40
//
41 204 dgisselq
#ifndef TWOC_H
42
#define TWOC_H
43
 
44
extern  long    sbits(const long val, const int bits);
45
extern  unsigned long   ubits(const long val, const int bits);
46
 
47
#endif
48
 

powered by: WebSVN 2.1.0

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