0% found this document useful (0 votes)
274 views6 pages

CIS 5100 Homework Assignment #2: Fall 2020, Dr. Song Xing Due On Monday, Oct 5

This document contains a homework assignment for a computer science class. It includes 10 questions about topics like data representation, memory addressing, data structures, sound cards, audio compression codecs, microprocessors, and digital data transmission encoding schemes. Students are asked to define terms, calculate values, compare options, search online for specifications, and diagram encodings.

Uploaded by

Oliver Bailey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
274 views6 pages

CIS 5100 Homework Assignment #2: Fall 2020, Dr. Song Xing Due On Monday, Oct 5

This document contains a homework assignment for a computer science class. It includes 10 questions about topics like data representation, memory addressing, data structures, sound cards, audio compression codecs, microprocessors, and digital data transmission encoding schemes. Students are asked to define terms, calculate values, compare options, search online for specifications, and diagram encodings.

Uploaded by

Oliver Bailey
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

CIS 5100 Homework Assignment #2

Fall 2020, Dr. Song Xing


Due on Monday, Oct 5

1. What is the numeric range of a 16-bit two’s complement value? A 16-bit


excess notation value? A 16-bit unsigned binary value?
2 complements: A 16-bit integer can store 2^16 distinct values. The range of
16-bit twos complement value is -2^(16-1) ~ (2^(16-1) -1)
or
-2^(15) ~ 2^(15 -1) or –32768 ~ +32767.
Excess notation: 16-bit excess notation value is -32768.
Unsigned binary: 16-bit unsigned value is 0-(2^(16-1) -1) or 0-65535.

2. Why might a programmer choose to represent a data item in IEEE binary128


floating-point format instead of IEEE binary64 floating-point format? What
additional costs might be incurred at runtime (when the application program
executes) as a result of using the 128-bit instead of the 64-bit format?
The reason why a programmer might choose longer format of floating point is
because they commit mistakes while programming long strings of data. The
larger format increases both the range of values that can be represented and
the precision of large and small values. Processing data represented in the
larger format requires more complex processing circuitry or the execution of
multiple instructions. Either requirement (but particularly the second) might
slow program execution.

3. What is an address? What is a pointer? What purpose are they used for?
An address represents a specific storage location in a storage device (such as
main memory). A pointer is a data item containing an address. Pointers and
memory addresses are used to tie together parts of a data structure, such as a
linked list or an indexed file.

4. How is an array stored in main memory? How is a linked list stored in main
memory? What are their comparative advantages and disadvantages? Give
examples of data that would be best stored as an array and as a linked list.
An array is stored in contiguous sequential memory locations, with the first
element at the lowest address. A linked list is stored in memory as an
unordered and noncontiguous set of list elements, each consisting of a data
value and a pointer to the next data list element.
1
Arrays are more compact and easier to read or write than linked lists. Linked
lists are easier to update than arrays.
Any data item that’s of fixed length and seldom changes value (such as a
customer name field) is best stored in an array. Data items that are of variable
length, are a large size, and have frequent value changes (such as a process
queue) are best stored as a linked list.

5. Assume a = 10 and b = 8. And a and b are loaded to two 5-bit registers in CPU.
1. ALU performs 5-bit addition c= a + b and saves c into a 5-bit register. If
the result c is more than 5 bits, drop off the leftmost bits to fit it into the 5-
bit register. What are the binary and the corresponding decimal numbers of
these three register values?
2. ALU performs 5-bit subtraction c= a - b and saves c into a 5-bit register. If
the result c is more than 5 bits, drop off the leftmost bits to fit it into the 5-
bit register. What are the binary and the corresponding decimal numbers of
these three register values?
3. Which one gives the right result? What happened if the result is wrong?
What solution(s) you would suggest for solving this problem?
We’re given a = 10 and b = 8 in Decimal notation we have to convert it into 5-bit
binary 2’s complement correspondence as well as found it values for -a (-10) and -b
(-8) in 5-bit binary 2’s complement. Also, c = a + b.
5-bit binary 2’s complement for ‘+8’: 01000.
5-bit binary 2’s complement for ‘-8’: 10110. (Inverse of +9 or sum of inverse of -8
and 00001).
5-bit binary 2’s complement for ‘+10’: 01010.
5-bit binary 2’s complement for ‘-10’: 10100. (Inverse of +11 or sum of inverse of -10
and 00001).

(1). For c = a + b = 10 + 8 = 01000 + 01010 = 10010 = 18.


This is a Correct answer. (As the 5-bit notation doesn’t overflow).

0 1 0 1 0 = 10 = a
+ 0 1 0 0 0 = 8 = b
= 1 0 0 1 0 = 18

2
(2). For c = a – b; it is performed by using c = a + (-b) = 01010 + 11000 = 100010 =
33. This answer is wrong as an OVERFLOW has occurred. The result is saved as 5 bits
(00010) i.e. 2 after the leftmost bit (1) is dropped to fill the result in the 5-bit register.

0 1 0 1 0 = 10 = a
+ 1 1 0 0 0 = -8 = b
1 0 0 0 1 0 = 33 7 Overflow
Bits
0 0 0 1 0 2 6 Bits (Dropping of the left most bit i.e. 1)

(3). In order to avoid the overflow, we increase the representing bits in the system. We would
add one more bit to data and then use 6-bit register to store each data. Since 6-bits notation
ranges from -26-1 ~ (26-1 -1) or -25 ~ (25 -1) or –32 ~ +31, the resulting subtraction will again
be in overflow. So, the first answer will be CORRECT. Therefore, first answer will give correct
result.

8 in 6-bit = 001000, -8 inverse will be = 110111+000001 = 111000.


Whereas, 10 in 6-bit will be 001000.
c = a-b = 001000+111000 = 1000010. This will be saved in 6-bits as 000010 which is ‘2’. This
will be considered as correct answer.

0 0 1 0 0 0 = 10 = A
+ 1 1 1 0 0 0 = -8 = B
1 0 0 0 0 1 0 = 130 7 Bits Overflow
0 0 0 0 1 0 = 2 6 Bits

6. Consider the following binary value:


1000 0000 0010 0110 0000 0110 1101 1001
What number (base 10) is represented if the value is assumed to represent a
number stored in 2’s complement notion? IEEE 754 floating-point notation
(IEEE binary32 floating-point format)?

Base 12 Base 10 Base 5 Base 2

+1A78 +3404 +102104 +110101001100

-90B2 -15698 -1000243 -11110101010010

3
7. Search the Internet for two types of computer sound cards with different
specifications. Write down their specifications for sampling frequency and the
number of bits. Identify which sound card would produce the lower quantization
error. What other characteristics are important when choosing a sound card?
The two types of sound cards with different specifications are:
1.PCI:
Ex: E-MU 0404, High quality audio card which gives two 24-bit analog unbalanced I/O.
96 kHz S/PDIF I/O and MIDI I/O1
Sampling Frequency: 96kHz-192kHz
Number of Bits: 24
2.Fireware Interface:
Ex: Compact Audio/MIDI interface with 24 Bit, 96kHz I/O S/PDIF and MIDI I/O and
onboard mixing facilities.
Sampling Frequency: 96kHz
Number of Bits: 24
-Sampling Frequency is more in PCI, but the number of bits is same for both, this will
cause the PCI to produce low quantization error.
Notable Characteristics while selecting Sound Card:
• Interface
• Synthesis type
• Cannels
• Polyphony
• Frequency response
• Sampling Rate
• Signal to Noise ratio
• Duplex mode
• Standards compatibility
• Sound Blaster
• Microsoft DirectSound
• Creative Labs EAX

8. Use the Web as a resource to list the audio compression codecs used in the voice
over IP.

List of audio compression codecs used in the voice over IP are:

• AMR Codec
• BroadVoice Codec 16Kbps narrowband, and 32Kbps wideband
• DoD CELP – 4.8 Kbps
• GIPS Family – 13.3 Kbps and up
• GSM – 13 Kbps (full rate), 20ms frame size
• iLBC – 15Kbps,20ms frame size: 13.3 Kbps, 30ms frame size
• ITU G.711 – 64 Kbps, sample-based Comes in two flavors: A-law and mu-law

4
• ITU G.722 – 48/56/64 Kbps ADPCM 7Khz audio bandwidth
• ITU G.722.1 – 24/32 Kbps 7Khz audio bandwidth (based on Polycom’s SIREN codec)
• ITU G.722.1C – 32 Kbps, a Polycom extension, 14Khz audio bandwidth
• ITU G.722.2 – 6.6Kbps to 23.85Kbps. Also known as AMR-WB. CELP 7Khz audio
bandwidth
• ITU G.723.1 – 5.3/6.3 Kbps, 30ms frame size
• ITU G.726 – 16/24/32/40 Kbps
• ITU G.728 – 16 Kbps
• ITU G.729 – 8 Kbps, 10ms frame size
• LPC10 – 2.5 Kbps
• Speex – 2.15 to 44.2 Kbps

Reference: https://www.voip-info.org/codecs/

9. Choose a commonly used microprocessor, such as the Intel Core


(www.intel.com) or AMD Ryzen (www.amd.com). What datatypes are supported?
How many bits are used to store each data type? How is each data type
represented internally?
A commonly used INTEL Microprocessor supports:

• Fundamental Data Types: 8 Bits (1 Byte) and 16 Bits (1 Word)


• Numeric Data Types: Byte Signed Integer (16 Bits or 8 Bits), Byte Unsigned (16 Bits
or 8 Bits), Word Signed (16 Bits), Words unsigned (16 Bits), Single Precision Floating
Point (32 Bits) and Double Precision Floating Point (64 Bits)
• Pointer Data Types: Near Pointer (32 or 64 Bits) and Far Pointer (32 or 64 Bits)
• String Data Types & Real Number: Real Number (32 or 64 Bits) and Floating Point
(32 or 64 Bits)

10. To transmit digital data using digital signal in the network such as Ethernet,
there are six digital encoding schemes: NRZ-L, NRZ-I, Manchester, differential
Manchester, and bipolar- AMI. Use the Web as a resource to study these
schemes. Draw in chart form (similar to the picture shown below) the voltage
representation of the decimal number 210 for the digital encoding schemes
NRZ-L, NRZ-I, Manchester, differential Manchester, and bipolar-AMI.

5
6

You might also like