N.B. These pastpapers may rely on the knowledge gained from the previous chapters.

Similar documents
CS & IT Conversions. Magnitude 10,000 1,

BINARY SYSTEM. Binary system is used in digital systems because it is:

Lecture (02) Operations on numbering systems

Computer Organization

UNIT 7A Data Representation: Numbers and Text. Digital Data

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

Basic Definition INTEGER DATA. Unsigned Binary and Binary-Coded Decimal. BCD: Binary-Coded Decimal

Number Systems Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. Indian Institute of Technology Kharagpur Number Representation

The type of all data used in a C++ program must be specified

Chapter 4: Computer Codes. In this chapter you will learn about:

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

Memory Addressing, Binary, and Hexadecimal Review

Introduction to Numbering Systems

Number System. Introduction. Decimal Numbers

N.B. These pastpapers may rely on the knowledge gained from the previous chapters.

Computer Organization & Systems Exam I Example Questions

CDA 3103 Computer Organization Exam 1 (Sep. 22th, 2014)

Groups of two-state devices are used to represent data in a computer. In general, we say the states are either: high/low, on/off, 1/0,...

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

DEPARTMENT OF MATHS, MJ COLLEGE

World Inside a Computer is Binary

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

CS 31: Intro to Systems Binary Arithmetic. Kevin Webb Swarthmore College January 26, 2016

MACHINE LEVEL REPRESENTATION OF DATA

Objectives. Connecting with Computer Science 2

Hexadecimal Numbers. Journal: If you were to extend our numbering system to more digits, what digits would you use? Why those?

A Level Computing. Contents. For the Exam:

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

CS 31: Introduction to Computer Systems. 03: Binary Arithmetic January 29

CS2630: Computer Organization Homework 1 Bits, bytes, and memory organization Due January 25, 2017, 11:59pm

Binary Codes. Dr. Mudathir A. Fagiri

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems

Data Representation 1

Introduction to Computers and Programming. Numeric Values

Operations On Data CHAPTER 4. (Solutions to Odd-Numbered Problems) Review Questions

COMP2611: Computer Organization. Data Representation

CSC201, SECTION 002, Fall 2000: Homework Assignment #2

Number representations

Semester Transition Point. EE 109 Unit 11 Binary Arithmetic. Binary Arithmetic ARITHMETIC

UNIVERSITY OF WISCONSIN MADISON

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

Goals for this Week. CSC 2400: Computer Systems. Bits, Bytes and Data Types. Binary number system. Finite representations of binary integers

Chapter 1. Digital Systems and Binary Numbers

Lecture (03) Binary Codes Registers and Logic Gates

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two 26 February 2014

The type of all data used in a C (or C++) program must be specified

More about Binary 9/6/2016

Chapter 2. Data Representation in Computer Systems

Advanced Computer Architecture-CS501

Internal Data Representation

2. MACHINE REPRESENTATION OF TYPICAL ARITHMETIC DATA FORMATS (NATURAL AND INTEGER NUMBERS).

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

Chapter 2 Exercises and Answers

Introduction to Computer Science-103. Midterm

Microprocessors & Assembly Language Lab 1 (Introduction to 8086 Programming)

Appendix. Bit Operators

Five classic components

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

Characters, Strings, and Floats

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr

Chapter 2 Bits, Data Types, and Operations

Final Labs and Tutors

Computer Sc. & IT. Digital Logic. Computer Sciencee & Information Technology. 20 Rank under AIR 100. Postal Correspondence

CS 31: Intro to Systems Binary Arithmetic. Martin Gagné Swarthmore College January 24, 2016

Number Systems (2.1.1)

Chapter 2 Bits, Data Types, and Operations

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

Number Systems. Dr. Tarek A. Tutunji Philadelphia University, Jordan

Number Systems. Both numbers are positive

Fundamental Data Types

Data Representation and Binary Arithmetic. Lecture 2

Inf2C - Computer Systems Lecture 2 Data Representation

Numbers and Representations

CSE COMPUTER USE: Fundamentals Test 1 Version D

OUTLINE. Number system. Creating MATLAB variables Overwriting variable Error messages Making corrections Entering multiple statements per line

Wednesday, September 6, 2017

The C++ Language. Arizona State University 1

CS107, Lecture 3 Bits and Bytes; Bitwise Operators

COMP Overview of Tutorial #2

CSCI 2212: Intermediate Programming / C Chapter 15

Thus needs to be a consistent method of representing negative numbers in binary computer arithmetic operations.

M1 Computers and Data

Numeral Systems. -Numeral System -Positional systems -Decimal -Binary -Octal. Subjects:

Chapter 2 Bits, Data Types, and Operations

Binary. Hexadecimal BINARY CODED DECIMAL

COMP2121: Microprocessors and Interfacing. Number Systems

Binary Representations and Arithmetic

Chapter 3: Arithmetic for Computers

Lecture 2: Number Systems

CS 354 Midterm 1a, 33.33% Monday, October 9th, 2000 Solution

Chapter 2. Positional number systems. 2.1 Signed number representations Signed magnitude

Signed Binary Numbers

Numbers and Computers. Debdeep Mukhopadhyay Assistant Professor Dept of Computer Sc and Engg IIT Madras

DRAM uses a single capacitor to store and a transistor to select. SRAM typically uses 6 transistors.

Data Representation. DRAM uses a single capacitor to store and a transistor to select. SRAM typically uses 6 transistors.

Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm. Nathan Pihlstrom.

Transcription:

N.B. These pastpapers may rely on the knowledge gained from the previous chapters.

1 SEC 95-PAPER 1-Q5 (a) A computer uses 8-bit two s complement numbers. In the space below fill in the largest positive binary number that can be represented in this computer. (b) Give the value to base 10 of the binary number you wrote above: (c) Show how an 8-bit computer using two s complement arithmetic calculates 37-121 (BASE 10) and get 84 (BASE 10) as an answer. [5]

2 SEC 96-PAPER 1-Q2c (CONSULT CH 4) How much storage is required for a single pixel in a display supporting up to 256 colours? [5]

3 SEC 96-PAPER 1-Q5 (a) Complete each row of the table to show the same number in binary, hexadecimal and decimal. BINARY HEXADECIMAL DECIMAL 1 0 1 1 0 1 0 1 = = = F 8 = = = 74 [2x3] (b) In a particular computer, positive numbers are represented as 8-bit quantities. i.what is the biggest number that can be stored in this way? ii. Give an example of an arithmetic operation which would cause a NU- MERIC OVERFLOW error in your computer [1] [1]

4 SEC 97-PAPER 1-Q7 Complete each row of the table to show the same number in binary, hexadecimal and decimal: BINARY HEXADECIMAL DECIMAL 0 1 1 0 1 0 1 1 = = = A E = = = 92 Working for question :

5 SEC 97-PAPER 2A-Q2 (a) Show how the following numbers would be stored in an 8-bit register using 2 s complement binary representation: (i) +47 (ii) 15 (b) Using two s complement arithmetic, show how the subtraction 47 15 is performed. (c) Can +130 be represented in two s complement using the 8-bit register? Explain why. [1] [1]

Writing Space for Previous Question

6 SEC 98-PAPER 1-Q7 Complete each row of the table to show the same number in binary, hexadecimal and decimal. BINARY HEXADECIMAL DECIMAL 0 1 0 1 0 0 1 0 = = = C A = = = 100

7 SEC 98-PAPER 2A-Q7 (a) A computer system uses an 8-bit character code. How many different characters can be represented on this system? (b) Suppose C1 and C2 are two characters. When is C1<C2? (c) The computer system also has a 16-bit word size. How many words are required to store the string HELLO? (d) Suppose S1 and S2 are two strings. When is S1<S2? (e) Briefly describe how negative integer numbers can be stored using (i) (ii) sign-and-magnitude; and 2s-complement numeric representation (f) Using an 8-bit number format, show how the number 100 is stored using [1] [4] (i) (iii) sign-and-magnitude; and 2s-complement numeric representation.

Writing Space for Previous Question

8 SEC 99-PAPER 1-Q8 Complete each row of the table to show the same number in binary, hexadecimal and decimal. BINARY HEXADECIMAL DECIMAL 0 0 1 1 0 1 1 1 = = = E B = = = 93

9 SEC 00-PAPER 1-Q6 Complete each row of the table to show the same unsigned number in binary, hexadecimal and decimal. BINARY HEXADECIMAL DECIMAL 1 0 1 0 1 1 0 1 = = = F 0 = = = 24 Working for question :

10 SEC 00-PAPER 2A-Q4C Part A (CONSULT CH 2) A computer uses two s complement code to store integer numbers. (a) Explain why internal code representations are binary-based. [1] A storage location within this computer has the following binary bit pattern in it: 01011010 i. What signed decimal number does this binary bit pattern represent? [1] ii. Use two s complement arithmetic to subtract the number 11100110 from 01011010. iii. What would be the outcome if 10000110 when subtracted from [3] 01011010? iv. Name two other possible things a binary bit pattern may represent.

11 SEC 01-PAPER 1-Q7 An LCD display is made of seven segments as shown below. To display digits, the correct segments have to be switched on. A byte of data is sent to the LCD such that each bit controls one segment with the exception of bit 7 (the most significant each byte). If a bit is 1, the segment is switched on. If a bit is 0, the segment is switched off. Assume bit 7 is always set to zero. To display the digit 5 shown below the following byte of data 00110111 is sent to the LCD. Bit 0 Bit 1 Bit 6 Bit 2 Bit 3 Bit 5 Bit 4 Bit 7 0 (a) Convert the following numbers into binary ACCORDING TO THEIR BASE and state which digits are displayed on the LCD by writing the corresponding values in the table below. The first one is worked out for you. Show your working. [4] Number Base Binary Display 55 Decimal 00110111 5 127 Decimal 96 Decimal 66 Hexadecimal 75 Hexadecimal (b) Why are memory locations often represented in hexadecimal rather than binary in printouts of sections of memory?

Writing Space for Previous Question

12 SEC 02-PAPER 1-Q7 Complete each row of the table to show the same unsigned number in binary, hexadecimal and decimal. BINARY HEXADECIMAL DECIMAL 1 1 0 0 1 0 1 1 = = = 5 F = = = 99 [6]

13 SEC 02 PAPER 2A Q3 (CONSULT CH 2) In a standard character code, both uppercase and lowercase letters are alphabetically ordered. Numeric symbols are also ordered according to their value. This attribute is called collating sequence. a. Why is it necessary to use a STANDARD character code for representing characters inside a computer? b. For what reason is the collating sequence property important for text data? c. A certain computer uses a character code specified in the given table to store character data. How is the STRING 1234 represented in a 32- bit word in this computer s memory? d. How is the unsigned number 1234 represented in this 32-bit register? Assuming an 8-bit register and twos compliment code, e. What is the largest negative integer number that can be represented using this 8-bit register? f. Represent the signed numbers 95 and 45 using the above system. g. Using twos compliment arithmetic to subtract 45 from 95. Comment on the result. Character Symbol Character Code...... <blank> 32(00100000)...... 0 49(00110001) 1 50(00110010) 2 51(00110011)...... A 65(01000001) [1] [2,2] [2,2]

Writing Space for Previous Question

14 SEC 03-PAPER 1 Q6 These questions relate to an 8-bit unsigned register. a. Represent the decimal number 81 as an unsigned binary number. b. How is the hexadecimal number A1 represented in this register? c. What is the biggest number which can be stored in this register?

15 SEC 03-PAPER 2A Q5 (CONSULT CH 2) (a) Assuming a 10-bit register, find the range of: i. Unsigned numbers ii. 2 s complement numbers Which can be stored in such a register. [2,4] (b) How many bits are required to represent 256 different characters? [1] (c) Mention a character coding system with which you are familiar. [1]

16 SEC 04-PAPER 1 Q10 10. Below is a diagram of an output port on a washing machine, e.g. when the number 24 (00011000) is output the machine is instructed to spin and to pump out water. 128 64 32 16 8 4 2 1 Spin on Heater on Water in Pump out Motor on a. What happens when 7 is output? b. What happens when 3 is output? c. What value (in decimal) must be output to have both the spin and heater on and everything else off? [6]

17 SEC 05-PAPER 1 Q6 (a) Fill in the following table: Decimal number 105 8-bit unsigned binary number 11011110 Hexadecimal number C0 [6] (b) Why are hexadecimal numbers used in Computing?

18 SEC 06-PAPER 1 Q4 ( CONSULT CH 2 ) Answer the following questions on data representation. (a) What decimal number is represented by each of the following unsigned numbers: (i) 01101001 2 (ii) B4 16 Ans: Ans: (b) What is the maximum unsigned number that may be represented in an 8- bit register? (c) Given that an 8-bit register stores the bit pattern 01101001, what bit pattern will it hold after two right shifts? (d) Given that an ASCII-type coding system codes the (capital) letter A with the decimal number 73, what decimal number is used to code the (capital) letter K? [1] (e) Why is it desirable to have standard character coding systems?

19 SEC 07-PAPER 1 Q6 Given an 8-bit register used to store unsigned numerical data in binary equivalent code: a) Write down the bit pattern of the register when representing the unsigned number 12. b) Write down the bit pattern of the register after a shift one right operation is performed on this register (which stores the unsigned number 12). c) What effect does this shift one right operation have on the unsigned number stored in the register. d) Confirm your answer by converting your answer to part (b) to its decimal equivalent