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

Subversion Repositories xulalx25soc

[/] [xulalx25soc/] [trunk/] [sw/] [twoc.cpp] - Diff between revs 46 and 78

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 46 Rev 78
Line 48... Line 48...
                r |= (-1l << bits);
                r |= (-1l << bits);
        return r;
        return r;
}
}
 
 
bool    sfits(const long val, const int bits) {
bool    sfits(const long val, const int bits) {
        long    alt = sbits(val, bits);
        // long alt = sbits(val, bits);
        return (sbits(val, bits) == bits);
        return (sbits(val, bits) == bits);
}
}
 
 
unsigned long   ubits(const long val, const int bits) {
unsigned long   ubits(const long val, const int bits) {
        unsigned long r = val & ((1l<<bits)-1);
        unsigned long r = val & ((1l<<bits)-1);

powered by: WebSVN 2.1.0

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