Lab4_de1.pdf - MCO455 LAB 4 NAME Page 1 STUDENT ID Bit...

This preview shows page 1 - 2 out of 2 pages.

© Copyright David Elmo Ross 2013 MCO455 LAB 4 Page 1 NAME: _______________________________ STUDENT ID #: ______________________________ Bit Manipulation, ARRAYS, & FUNCTIONS LAB SECTION: A B C D E F G H I J K L M N O P AFTER WATCHING THE LAB 4 VIDEO and reading Chapter 2: 1. On the bottom of Page 46 of chapter 2 is the following code: a=SWH & 0x02; if (a) LEDG=LEDG | 0x80; else LEDG=LEDG & 0x7f; In the if (a) statement what two possible values can the variable a have? ______ or _____ 2. Of the following statements, WHICH will cause the MSB green led to turn on . Circle your choice(s): (A) if ( 9 ) LEDG = LEDG | 0x80; else LEDG = LEDG & 0x7F; (B) a=SWH & 0x02; if (a = = 1) LEDG = LEDG | 0x80; // Circle this if any SWH combination turns else LEDG = LEDG & 0x7F; // on the MSB GREEN led (C) a = SWH & 0x02; if ( ! a ) LEDG = LEDG & 0x7F; // Circle this if any SWH combination turns else LEDG = LEDG | 0x80; // on the MSB GREEN led (D) if ( -7 ) LEDG = LEDG | 0x80; else LEDG = LEDG & 0x7F; (E) if ( ! 0 ) LEDG = LEDG | 0x80; else LEDG = LEDG & 0x7F; 3. Write a program that uses the following arrays: unsigned char bob [ ] = { 0xAB, 0xCD }; unsigned char fred [2]; The program should switch the hex digits in both elements of bob
Image of page 1

Subscribe to view the full document.

Image of page 2
You've reached the end of this preview.
  • Summer '16
  • Scott, Richards
  • Light-emitting diode, Nixie tube, bottom of Page

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern