B.6. Negative Binary Numbers: Twos Complement Notation

Answers to Self Review Exercises

B.1

a) 10, 2, 8, 16. b) 1 (the base raised to the zero power). c) The base of the number system.

B.2

a) False. Hexadecimal does this. b) False. The highest digit in any base is one less than the base. c) False. The lowest digit in any base is zero.

B.3

Fewer.

B.4

Hexadecimal.

B.5

Fill in the missing values in this chart of positional values for the rightmost four positions in each of the indicated number systems:

decimal

1000

100

10

1

hexadecimal

4096

256

16

1

binary

8

4

2

1

octal

512

64

8

1

B.6

Octal 6530; Hexadecimal D58.

B.7

Binary 1111 1010 1100 1110.

B.8

Binary 111 011 001 110.

B.9

Binary 0 100 111 111 101 100; Octal 47754.

B.10

Decimal 2+4+8+32+64=110.

B.11

Decimal 7+1*8+3*64=7+8+192=207.

B.12

Decimal 4+13*16+15*256+14*4096=61396.

B.13

Decimal 177 to binary:

256 128 64 32 16 8 4 2 1
128 64 32 16 8 4 2 1
(1*128)+(0*64)+(1*32)+(1*16)+(0*8)+(0*4)+(0*2)+(1*1)
10110001
 

to octal:

512 64 8 1
64 8 1
(2*64)+(6*8)+(1*1)
261
 

to hexadecimal:

256 16 1
16 1
(11*16)+(1*1)
(B*16)+(1*1)
B1
B.14

Binary:

512 256 128 64 32 16 8 4 2 1
256 128 64 32 16 8 4 2 1
(1*256)+(1*128)+(0*64)+(1*32)+(0*16)+(0*8)+(0*4)+(0*2)+(1*1)
110100001
 

One's complement: 001011110
Two's complement: 001011111
Check: Original binary number + its two's complement

110100001
001011111
---------
000000000
B.15

Zero.

Exercises

B.16

Some people argue that many of our calculations would be easier in the base 12 number system because 12 is divisible by so many more numbers than 10 (for base 10). What is the lowest digit in base 12? What would be the highest symbol for the digit in base 12? What are the positional values of the rightmost four positions of any number in the base 12 number system?

B.17

Complete the following chart of positional values for the rightmost four positions in each of the indicated number systems:

decimal

1000

100

10

1

base 6

...

...

6

...

base 13

...

169

...

...

base 3

27

...

...

...

B.18

Convert binary 100101111010 to octal and to hexadecimal.

B.19

Convert hexadecimal 3A7D to binary.

B.20

Convert hexadecimal 765F to octal. (Hint: First convert 765F to binary, then convert that binary number to octal.)

B.21

Convert binary 1011110 to decimal.

B.22

Convert octal 426 to decimal.

B.23

Convert hexadecimal FFFF to decimal.

B.24

Convert decimal 299 to binary, to octal and to hexadecimal.

B.25

Show the binary representation of decimal 779. Then show the one's complement of 779 and the two's complement of 779.

B.26

Show the two's complement of integer value 1 on a machine with 32-bit integers.

Appendix C Using the Visual Studio 2005 Debugger

Preface

Index

    Introduction to Computers, the Internet and Visual C#

    Introduction to the Visual C# 2005 Express Edition IDE

    Introduction to C# Applications

    Introduction to Classes and Objects

    Control Statements: Part 1

    Control Statements: Part 2

    Methods: A Deeper Look

    Arrays

    Classes and Objects: A Deeper Look

    Object-Oriented Programming: Inheritance

    Polymorphism, Interfaces & Operator Overloading

    Exception Handling

    Graphical User Interface Concepts: Part 1

    Graphical User Interface Concepts: Part 2

    Multithreading

    Strings, Characters and Regular Expressions

    Graphics and Multimedia

    Files and Streams

    Extensible Markup Language (XML)

    Database, SQL and ADO.NET

    ASP.NET 2.0, Web Forms and Web Controls

    Web Services

    Networking: Streams-Based Sockets and Datagrams

    Searching and Sorting

    Data Structures

    Generics

    Collections

    Appendix A. Operator Precedence Chart

    Appendix B. Number Systems

    Appendix C. Using the Visual Studio 2005 Debugger

    Appendix D. ASCII Character Set

    Appendix E. Unicode®

    Appendix F. Introduction to XHTML: Part 1

    Appendix G. Introduction to XHTML: Part 2

    Appendix H. HTML/XHTML Special Characters

    Appendix I. HTML/XHTML Colors

    Appendix J. ATM Case Study Code

    Appendix K. UML 2: Additional Diagram Types

    Appendix L. Simple Types

    Index



    Visual C# How to Program
    Visual C# 2005 How to Program (2nd Edition)
    ISBN: 0131525239
    EAN: 2147483647
    Year: 2004
    Pages: 600

    Flylib.com © 2008-2020.
    If you may any questions please contact us: flylib@qtcs.net