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

Subversion Repositories instruction_list_pipelined_processor_with_peripherals

[/] [instruction_list_pipelined_processor_with_peripherals/] [trunk/] [program_rom/] [romCreate.plx] - Diff between revs 9 and 10

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

Rev 9 Rev 10
Line 68... Line 68...
        print FILE_V "\n\n\t\t\tdefault\t:\tcode = 15'b111111111111111;";
        print FILE_V "\n\n\t\t\tdefault\t:\tcode = 15'b111111111111111;";
        print FILE_V "\n\t\tendcase\nend\n\nendmodule\n";
        print FILE_V "\n\t\tendcase\nend\n\nendmodule\n";
 
 
 
 
 
 
sub bin2hex {
 
     my $bin = shift;
 
 
 
    # Make input bit string a multiple of 4
 
    #$bin = substr("0000",length($bin)%4) . $bin if length($bin)%4;
 
 
 
    my ($hex, $nybble) = ("");
 
    while (length($bin)) {
 
                ($nybble,$bin) = (substr($bin,0,4), substr($bin,4)); # (substr($bin,0,4), substr($bin,4));
 
                #substr extracts a substring . . .
 
        $nybble = eval "0b$nybble";
 
        $hex .= substr("0123456789ABCDEF", $nybble, 1);
 
    }
 
    return $hex;
 
}
 
 
 
 
 
 
 
 
 
 
 
##############
##############
# getOpcode
# getOpcode
 
 

powered by: WebSVN 2.1.0

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