// The function "printDisplay" is intended to help verify the // two-digit seven segment decoder output from the decade counter. // "seg1" is the most significant digit and "seg2" the least // significant digit. // // To use this function from Handel-C, include the following declaration // (uncommented!) in your Handel-C code: // extern "C++" void printDisplay(unsigned 8 seg1, unsigned 8 seg2); #include #include using namespace HCNum; static void printSeg(UInt<8> seg) { switch (seg.IntOf()) { case 0x3f : printf("0"); break; case 0x06 : printf("1"); break; case 0x5b : printf("2"); break; case 0x4f : printf("3"); break; case 0x66 : printf("4"); break; case 0x6d : printf("5"); break; case 0x7c : printf("6"); break; case 0x07 : printf("7"); break; case 0x7f : printf("8"); break; case 0x67 : printf("9"); break; default : printf("?"); } } void printDisplay(UInt<8> seg1, UInt<8> seg2) { printSeg(seg1); printSeg(seg2); printf("\n"); }