Course Hero Logo

When setting outputs use a statement ending with a

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 20 - 26 out of 50 pages.

When setting outputs, use a statement ending with a semicolon. Use hex whenappropriate, and use uppercase (0xFF, not 0xff).1)Set RIMS'rst output pin to 1.Animation captions:1.Four bits have 16 possible combinations and can represent a range from 0 to 15.2.Given a binary number, every four bits can be represented with one hex digit. 0011 in binaryis represented by the hex digit 3. 1110 in binary is represented by the hex digit E.3.Setting B = 240 doesn't convey the desired pattern of 11110000. Rather, setting B = 0xF0better conveys the desire to assign therst four bits to 1 and the latter four bits to 0.StartMatch thehex valuein binary.23451800000000CheckNext1©zyBooks 11/05/21 13:36 231883Lawrence NderuAk78Fta73x©zyBooks 11/05/21 13:36 231883Lawrence NderuAk78Fta73xFirefox20 of 5011/5/2021, 1:37 PM
2)Set RIMS'rst output pin to 1and all other pins to 0.3)Set RIMS' last output pin to 1and all other pins to 0.4)Set RIMS' outputs to all 1s.5)Set RIMS' outputs to 01010101.6)Fill in the blank of thisexpression to detect that all 8RIMS inputs are 1s:A == ____.7)What expression detects thatRIMS'rst input pin is 1?CheckShow answerCheckShow answerCheckShow answerCheckShow answerCheckShow answerCheckShow answerCheckShow answer©zyBooks 11/05/21 13:36 231883Lawrence NderuAk78Fta73x©zyBooks 11/05/21 13:36 231883Lawrence NderuAk78Fta73xFirefox21 of 5011/5/2021, 1:37 PM
8)What expression detects that A0is the only RIMS input that is 1?PARTICIPATIONACTIVITY2.4.3: RIMS and hex.Write a single statement for RIMS that sets B7-B4 to 1s and B3-B0 to 0s, using a hexconstant.CheckShow answerFull screenA = 0A00A10A20A30A40A50A60A70#include"RIMS.h"intmain() {while(1) {B0=A0&&A1;}return0;}1234567©zyBooks 11/05/21 13:36 231883Lawrence NderuAk78Fta73x©zyBooks 11/05/21 13:36 231883Lawrence NderuAk78Fta73xFirefox22 of 5011/5/2021, 1:37 PM
PARTICIPATIONACTIVITY2.4.4: Using hex again.Write a single statement for RIMs that sets B0 to 1 if all eight A inputs are 1s, using a hexconstant.CompileSimulation speed:Normal0.00 sB0B1B2B3B4B5B6B7B = 000000000RunStopContinueBreakStepGenerate timing diagramFull screen©zyBooks 11/05/21 13:36 231883Lawrence NderuAk78Fta73x©zyBooks 11/05/21 13:36 231883Lawrence NderuAk78Fta73xFirefox23 of 5011/5/2021, 1:37 PM
A = 0A00A10A20A30A40A50A60A70#include"RIMS.h"intmain() {while(1) {B0=A0&&A1;}return0;}1234567©zyBooks 11/05/21 13:36 231883Lawrence NderuAk78Fta73x©zyBooks 11/05/21 13:36 231883Lawrence NderuAk78Fta73xFirefox24 of 5011/5/2021, 1:37 PM
Example 2.4.1: Simple hexadecimal example.The following program sets B to 00000000 when A1A0=00, to 01010101 when A1A0=01,to 10101010 when A1A0=10, and to 11111111 when A1A0=11.#include"RIMS.h"// Set B to 00000000 when A1A0=00, to 01010101 when A1A0=01,// to 10101010 when A1A0=10, and to 11111111 when A1A0=11voidmain(){while(1){if(!A1&& !A0){B=0x00;// 0000 0000}else if(!A1&&A0){B=0x55;// 0101 0101}else if(A1&& !A0){B=0xAA;// 1010 1010}else if(A1&&A0){B=0xFF;// 1111 1111}}}B0B1B2B3B4B5B6B7B = 000000000©zyBooks 11/05/21 13:36 231883Lawrence NderuAk78Fta73x©zyBooks 11/05/21 13:36 231883Lawrence NderuAk78Fta73xFirefox25 of 5011/5/2021, 1:37 PM

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 50 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Summer
Professor
morrisobuhuma
Tags
Binary numeral system, Bitwise operation, LAWRENCE NDERU

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture