Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

When a credit card is scanned, a sequence of 8-bit codes appears on the scanner’

ID: 664549 • Letter: W

Question

When a credit card is scanned, a sequence of 8-bit codes appears on the scanner’s data output lines (SCAN_DATA8-1). Each byte is held on these lines for about 1 microsecond; when that byte is stable on these lines, a short pulse (0-1-0) is generated on the scanner’s DATA_VALID output line. The data byte should be read while that pulse is active. To display a character, its ASCII code must be placed on the display’s data input lines (DATA_IN8-1) and then the display’s STROBE input line raised from low to high (it can be returned low at any time.) When the STROBE signal is thus activated, the display’s READY* output line goes to its inactive state (high) until the display has processed that character. Then READY* returns to its active state (low). The DATA_IN8-1 lines must not be disturbed while the display is in a “not ready” state. 1. The scanner is to be interfaced to our microcontroller using GPIOB pins, and the display using GPIOC pins. List appropriate GPIO pins to connect to each of the signal lines on these two devices. 2. Write a subroutine that initializes the port pins connected to these two devices. 3. Write a subroutine that returns, in R0, the 8-bit code of the next byte produced by the scanner. This subroutine should use a “busy/wait” structure. 4. Write a subroutine that will display a string of ASCII characters, stored in array “String” in data memory. The end of the character string is the ASCII "null" character (0x00). Again, busy/wait operation should be used. These programs should be entered into MDK-ARM, assembled, and printed.

Explanation / Answer

import java.util.Scanner; public class CreditCardValidation { public static boolean isValid(long number) { int total = sumOfDoubleEvenPlace(number) + sumOfOddPlace(number); if ((total % 10 == 0) && (prefixMatched(number, 1) == true) && (getSize(number)>=13 ) && (getSize(number)
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote