Birkbeck (University of London) Department of Computer Science and Information Systems. Introduction to Computer Systems (BUCI008H4)

Similar documents
Birkbeck (University of London) Department of Computer Science and Information Systems. Introduction to Computer Systems (BUCI008H4)

Mid-term Examination

COMP1917 Computing 1 Written Exam Sample Questions

Sample Examination. Family Name:... Other Names:... Signature:... Student Number:...

Introduction to Computer Science-103. Midterm

Chapter 4. Operations on Data

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

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

Number System. Introduction. Decimal Numbers

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

COMP Overview of Tutorial #2

FLOATING POINT NUMBERS

Introduction to Computers and Programming. Numeric Values

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

Read this before starting!

Chapter 3: Arithmetic for Computers

18. Machine Language. Computer Systems. COMP1917: Computing 1. Machine Language Programming. History of Computer Technology

COSC 243. Data Representation 3. Lecture 3 - Data Representation 3 1. COSC 243 (Computer Architecture)

1. Which of the following Boolean operations produces the output 1 for the fewest number of input patterns?

FLOATING POINT NUMBERS

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

Name: CMSC 313 Fall 2001 Computer Organization & Assembly Language Programming Exam 1. Question Points I. /34 II. /30 III.

UNCA CSCI 255 Exam 1 Spring February, This is a closed book and closed notes exam. It is to be turned in by 1:45 PM.

Number Systems. Binary Numbers. Appendix. Decimal notation represents numbers as powers of 10, for example

Binary. Hexadecimal BINARY CODED DECIMAL

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

WYSE Academic Challenge 2002 Computer Science Test (Sectional) SOLUTION

Read this before starting!

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

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

Experimental Methods I

CS101 Lecture 04: Binary Arithmetic

Birkbeck (University of London) MSc Examination. Department of Computer Science and Information Systems. Fundamentals of Computing (COIY058H7)

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

UNIVERSITY OF WISCONSIN MADISON

Read this before starting!

CS & IT Conversions. Magnitude 10,000 1,

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

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

1. NUMBER SYSTEMS USED IN COMPUTING: THE BINARY NUMBER SYSTEM

±M R ±E, S M CHARACTERISTIC MANTISSA 1 k j

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

Number Systems CHAPTER Positional Number Systems

Number Systems. Decimal numbers. Binary numbers. Chapter 1 <1> 8's column. 1000's column. 2's column. 4's column

IBM 370 Basic Data Types

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


ECE 30 Introduction to Computer Engineering

Declaring Floating Point Data

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems

Lecture 2: Number Systems

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

CDS130 Mid-term exam: Sample

Binary Adders: Half Adders and Full Adders

Chapter 2 Bits, Data Types, and Operations

Software and Hardware

CONCORDIA UNIVERSITY Department of Computer Science and Software Engineering COMP 228/4 Section PP Midterm Exam

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

CS2214 COMPUTER ARCHITECTURE & ORGANIZATION SPRING 2014

Divide: Paper & Pencil

Computer Organisation CS303

Chapter 2 Bits, Data Types, and Operations

Computer Science 121. Scientific Computing Winter 2016 Chapter 3 Simple Types: Numbers, Text, Booleans

MACHINE LEVEL REPRESENTATION OF DATA

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.

Operators and Expressions in C & C++ Mahesh Jangid Assistant Professor Manipal University, Jaipur

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

Chapter 2 Bits, Data Types, and Operations

COMS 1003 Fall Introduction to Computer Programming in C. Bits, Boolean Logic & Discrete Math. September 13 th

Bits, Words, and Integers

Signed umbers. Sign/Magnitude otation

Chapter 1. Data Storage Pearson Addison-Wesley. All rights reserved

Integers. N = sum (b i * 2 i ) where b i = 0 or 1. This is called unsigned binary representation. i = 31. i = 0

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System

SISTEMI EMBEDDED. Basic Concepts about Computers. Federico Baronti Last version:

Read this before starting!

Signed Multiplication Multiply the positives Negate result if signs of operand are different

Read this before starting!

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

MYcsvtu Notes DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes

CS/EE1012 INTRODUCTION TO COMPUTER ENGINEERING SPRING 2013 HOMEWORK I. Solve all homework and exam problems as shown in class and sample solutions

Signed Binary Numbers

11/22/1999 7pm - 9pm. Name: Login Name: Preceptor Name: Precept Number:

Le L c e t c ur u e e 2 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Variables Operators

Chapter 3 Data Representation

The CPU and Memory. How does a computer work? How does a computer interact with data? How are instructions performed? Recall schematic diagram:

Chapter 1 Review of Number Systems

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

CS/COE 0447 Example Problems for Exam 2 Spring 2011

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

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

Set Theory in Computer Science. Binary Numbers. Base 10 Number. What is a Number? = Binary Number Example

Computer Arithmetic. Appendix A Fall 2003 Lec.03-58

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition

A B C ((NOT A) AND B) OR C

CPE 323 REVIEW DATA TYPES AND NUMBER REPRESENTATIONS IN MODERN COMPUTERS

CMPSCI 145 MIDTERM #1 Solution Key. SPRING 2017 March 3, 2017 Professor William T. Verts

4/8/17. Admin. Assignment 5 BINARY. David Kauchak CS 52 Spring 2017

Transcription:

Birkbeck (University of London) Department of Computer Science and Information Systems Introduction to Computer Systems (BUCI008H4) CREDIT VALUE: none Spring 2017 Mock Examination Date: Tuesday 14th March 2017 Duration: 18.00 19.20 NAME: There are seven questions in this paper. Answer all seven questions. Each question carries 10 marks in total. Calculators and other electronic devices are not permitted. The examination is closed book. No supplementary material is provided. This paper is not prior disclosed. BUCI008H4 Page 1 of 9 c Birkbeck College 2017

1. Show your working in all parts of this question. (a) Add the binary numbers 10010 and 1011. (b) Subtract the binary number 1011 from the binary number 10011. Multiply 2 10, i.e. two to the power ten, and 2 13, i.e. two to the power thirteen. An answer in the form of a power of two is required. (d) Convert the binary number 10110 to the corresponding decimal number. (e) Convert the hexadecimal numbers A and B to the corresponding decimal numbers, add the decimal numbers and convert the result to hexadecimal form. BUCI008H4 Page 2 of 9 c Birkbeck College 2017

2. Show your working in all parts of this question. (a) Write out the table for the three bit excess notation for integers. Show clearly the integers which can be represented using the three bit excess notation. (b) Obtain the four bit two s complement representations for the integers -1 and 2. Obtain from these two s complement representations the two s complement representation for the integer 1. Note that -1+2 is equal to 1. Find two integers m, n with corresponding three bit excess representations s, t, such that i) m + n has a three bit excess representation u; and ii) u is not equal to the rightmost three bits of the bit string obtained by adding s and t as if they were binary numbers. BUCI008H4 Page 3 of 9 c Birkbeck College 2017

3. (a) State the name of one binary Boolean operation. Explain the meaning of the word binary in this context. (b) Write out the truth table for the Boolean operation A == B. If A and B have the same value, then A == B is true (1 or T is also accepted), otherwise A == B is false (0 or F is also accepted). Describe one way in which Boolean operations are used in programming languages. 4. The Brookshear floating point representation for a binary fraction x consists of eight bits, labeled s, e 1, e 2, e 3, m 1, m 2, m 3, m 4 from left to right. If x is zero, then all eight bits are zero. If x is strictly negative, then the sign bit s is 1. If x is strictly positive, then the bit s is zero. Next, suppose x is not zero. To obtain the remaining seven bits, x is written in the form ±2 r 0.t where r is an integer and t is a bit string such that the leftmost bit of t is 1. The bits e 1, e 2, e 3 together comprise the three bit excess notation for r and the bits m 1, m 2, m 3, m 4 of the mantissa are the leftmost four bits of t. Question 4 continued on next page BUCI008H4 Page 4 of 9 c Birkbeck College 2017

(a) Obtain the Brookshear floating point representation for the decimal fraction 1/16. In your answer show the value of r and the value of the bit string 0.t. (8 marks) (b) Suppose that the Brookshear floating point representation for a non-zero number x is given. Explain how it is possible to obtain quickly the Brookshear floating point representation for the number 2x, under the assumption that the representation of 2x exists. BUCI008H4 Page 5 of 9 c Birkbeck College 2017

5. The table included below in this question describes instructions of length 16 bits, made by concatenating an op-code and an operand. The first four bits record the op-code. The remaining 12 bits record the operand. Four bits are required to specify a register R and eight bits are required to specify a memory location XY. Each register holds eight bits and each memory location holds eight bits. Each 16 bit instruction is coded by four hexadecimal digits. For example, the four hexadecimal digits 37A9 specify an instruction with op-code 3, in which the 7 refers to register 7 and A9 refers to the memory cell A9. The registers are numbered in hexadecimal from 0 to F. All memory addresses in this question are given in hexadecimal notation. Op code Operand Description 1 RXY Load register R with the bit pattern in memory cell XY. 2 RXY Load register R with the bit pattern XY. 3 RXY Store the bit pattern in register R at memory cell XY. 4 0RS Move the bit pattern in register R to register S. 5 RST Add (two s complement) the bit patterns in registers R and S. Put the result in register T. 6 RST Add (floating point) the bit patterns in registers R and S. Put the result in register T. 7 RST Or the bit patterns in registers S and T. Put the result in register R. 8 RST And the bit patterns in registers S and T. Put the result in register R. 9 RST Exclusive Or the bit patterns in registers S and T. Put the result in register R. A R0X Rotate the bit pattern in register R one bit to the right X times. B RXY Jump to the instruction in memory cell XY if the bit pattern in register R is equal to the bit pattern in register 0. C 000 Halt. (a) Describe the result of the instruction 9312 when register 1 contains A6 (in binary 10100110) and register 2 contains F F (in binary 11111111). BUCI008H4 Page 6 of 9 c Birkbeck College 2017

(b) Write a program in machine code to i) read the contents of the memory cell with the hexadecimal address 91 into register 1; then ii) flip the bits of the bit string in register 1 and put the resulting bit string in register 3; and finally iii) copy the bit string in register 3 to the memory cell with address 91. The bits in a bit string are flipped by converting 0 to 1 and 1 to 0. For example, if the bit string is 00110011, then flipping the bits yields the bit string 11001100. (6 marks) BUCI008H4 Page 7 of 9 c Birkbeck College 2017

6. (a) Give a definition of the term algorithm. Give a definition of the term variable, as this term might be used when describing an algorithm. (b) State one advantage in using a high level programming language to implement algorithms. Consider the following statement. To convert degrees centigrade into degrees Fahrenheit, multiply by 9/5 and add 32. This statement is to be the basis for an algorithm. Identify the input and the output of the algorithm. Suggest two variables that might be used in an implementation of this algorithm. BUCI008H4 Page 8 of 9 c Birkbeck College 2017

7. Recall that an array is a block of values of the same type, for example, A = ( 1 2 ) 4 0 9 6 The indexing of the rows and columns of an array starts in each case from 0 and the index for the rows is given first. For example, A[0, 1] has the value 2. (a) Describe one way in which the array A might be stored in a computer memory. Use a diagram to show clearly where the different values in A are placed. You may assume that each entry of A is stored in a single memory cell. (b) If the memory cell for the value 1 is x then what is the memory cell for the value 9? Let x be the memory cell in which A[0, 0] is stored. Show how the location of the memory cell holding A[i, j] can be calculated using the values of x, i and j. BUCI008H4 Page 9 of 9 c Birkbeck College 2017