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

PROBLEMS SECTION 7.1: DATA TYPES AND TIME DELAYS IN C I. Indicate what data type

ID: 2248827 • Letter: P

Question

PROBLEMS SECTION 7.1: DATA TYPES AND TIME DELAYS IN C I. Indicate what data type you would use for the following variables: (a) temperature (b) the number of days in a week (c) the number of days in a year (d) the number of months in a year (e) a counter to track the number of people getting on a bus (f a counter to track the number of people going to a class (g) an address of 64K RAM space (h) the age of a person (i) a string for a message to welcome people to a building 2. Give the hex value that is sent to the port for each of the following C statements (a) PORTB-14; (d) PORTB-7; (g) PORTB-255; (b) PORTB=0x18; (e) PORTB-32; (h) PORTB-0xOF: (c) PORTB-A; (t) PORTB-0x45; 3. Give two factors that can affect time delay in the AVR microcontroller 4. Of the two factors in Problem 3, which can be set by the system designer? 5. Can the programmer set the number of clock eycles used to execute an instrue- tion? Explain your answer Explain why various C compilers produce different hex file sizes. 6.

Explanation / Answer

(1)

(a) For temperature FLOAT datatype used.

(b) For number of days in a week short data type is used.

(c) For number of days in a year short data type is used.

(d) For number of months in a year short data type is used.

(E) a counter to track the people getting on a bus ENUM data type is used.

(f) a counter to track the people getting on a bus ENUM data type is used.

(g) For adress Double datatype is used.

(h) For age of a person Unsigned char datatype is used.

(i) For a string void datatype is used.

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