202201-midterm-1

.pdf

School

University of Victoria *

*We aren’t endorsed by this school

Course

230

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

10

Uploaded by PresidentStrawSwan18

Page 1 of 10 CSC 230 Summer 2022 (A01: CRN 30207; A02: CRN 30208) Midterm #1: Thursday, 2 June 2022 Marking Key Students must check the number of pages in this examination paper before beginning to write, and report any discrepancy immediately. All answers are to be written on this exam paper. The exam is closed book. Other than the AVR reference booklet provided to you, no books or notes are permitted. When answering questions, please do not detach any exam pages! A basic calculator is permitted . Cellphones must be turned off. Partial marks are available for the questions in sections B and C. The total marks for this exam is 76. There are ten (10) printed pages in this document, including this cover page. We strongly recommend you read the entire exam through from beginning to end before starting on your answers. Please have your UVic ID card available for inspection by an exam invigilator.
Page 2 of 10 Section A (36 marks): For each question in this section, place an X beside all answers that apply. Each question is worth three (3) marks. Partial marks are not given for incomplete answers . Remember: Hexadecimal numbers begin with 0x ; binary numbers begin with 0b ; octal numbers begin with 0 ; and all other numbers are decimal . All numbers are unsigned unless the question specifies otherwise. Question 1: The unsigned integer 0x345 can be represented as: _____ 0b010101000011 _____ 0b011100101 __X__ 0b001101000101 _____ 0575 _____ None of the above. Question 2: The unsigned integer 0b10100011 is equivalent to: __X__ 163 _____ 0xA1 _____ 147 _____ 0xA5 _____ None of the above. Question 3: The unsigned integer 0755 is equivalent to: _____ 0b1011101101 _____ 0x1DF _____ 0x1CD _____ 0b011101010101 __X__ None of the above.
Page 3 of 10 Question 4: The decimal number -27 represented as a 10-bit two’s complement number is equivalent to: _____ 0b1000011011 _____ 0b1111100100 __X__ 0b1111100101 _____ 0b1000000101 _____ None of the above. Question 5: The six-bit two’s complement number 0b101111 is equivalent to: _____ 0b00101111 as an eight-bit two’s complement number. _____ -31 _____ -15 _____ -29 __X__ None of the above. Question 6: If we consider I/O port B, then: _____ we set the data-direction for each bit (input or output) by an appropriate value stored in the PINB and PORTB registers. __X__ we set the data-direction for each bit (input or output) by an appropriate value stored in the DDRB register. __X__ we read values from the port by reading from the PINB register. _____ we read values form the port by reading from the PORTB register. _____ None of the above.
Page 4 of 10 Question 7: The largest positive value that can be represented using a five-bit two’s complement number is: _____ 0b10000 __X__ 0b01111 _____ 64 _____ 31 _____ None of the above. Question 8: The most negative value that can be represented using a six-bit two’s complement number is: __X__ 0b100000 _____ 0b111111 _____ -31 __X__ -32 _____ None of the above. Question 9: The fetch-decode-execute cycle : _____ Describes the steps taken when the assembler generates a sequence of fet , dec , and exe instructions that appear in a loop. __X__ Permits the AVR mega2560 to fetch and decode an instruction in one cycle, and to execute it in the next cycle(s). _____ Permits the AVR mega2560 to fetch, decode, and execute an instruction in one cycle. _____ Is another name for the meaning of the brne instruction . _____ None of the above.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help