Some Binary Bits and Pieces - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

Some Binary Bits and Pieces

Description:

Eight binary digits are called a byte. ... (b) Diminished Radix Complement (One's Complement) (c) Radix Complement (Two's Complement) ... – PowerPoint PPT presentation

Number of Views:78
Avg rating:3.0/5.0
Slides: 22
Provided by: brian328
Category:
Tags: binary | bits | pieces | radix

less

Transcript and Presenter's Notes

Title: Some Binary Bits and Pieces


1
Some Binary Bits and Pieces
  • Terminology
  • Each binary digit is called a bit.
  • Eight binary digits are called a byte.
  • The left most bit is called the most significant
    bit (or MSB).
  • The right most bit is called the least
    significant bit (or LSB).
  • Range is 0 . 2N - 1

2
Binary Arithmetic(1)
Rules for binary arithmetic are the same as for
decimal arithmetic. 0 0 1 0 1 0 1 0 42 0 0 0
1 1 1 1 1 31 0 1 0 0 1 0 0 1 73
3
Binary Arithmetic(2)
Another example 0 0 0 0 1 0 1 1 11 0 0 0
1 0 1 0 1 21
4
Binary Arithmetic(3)
Another example 0 0 0 1 0 1 0 1 - 21 0 0 0
0 1 0 1 1 11
5
Examples

6
Try This
1 0 0 0 1 1 1 0 1 0 0 0 0 0 1 1 Remember we
are only using 8 bit number representation

7
Overflow
Binary numbers often have to be held in a fixed
number of bits. This introduces the problem of
overflow.
8
Signed and Unsigned Numbers
The previous section assumes only positive
numbers are represented. Three methods you should
know about for representing negative numbers (all
use the same method for positive numbers) (a)
Sign and Magnitude (b) Diminished Radix
Complement (Ones Complement) (c) Radix
Complement (Twos Complement)
9
Twos Complement(1)
Any pattern whose sign bit is 1 represents the
negative ofthe value obtained by replacing each
1 with a 0 and each 0with a 1, and then adding 1
to the final value. So, as with ones complement
except you add an extra one(hence twos
complement!). e.g. 1 0 1 1 0 1 1 1 is a negative
number. Changing 1?0 and 0 ?1 gives Adding 1
gives
10
Twos Complement(2)
Range is - (2 N-1) to (2 N -1 - 1) So for 8
bits this is
11
Twos Complement(3)
You can perform arithmetic in twos complement
using only addition . So for example to evaluate
41-31 we add 41 and the representation of -31
together.
12
Twos Complement(4)
  • Now try this
  • 66 - 36

13
More Examples (2s complement)

14
Error Checking
PARITY is a method for checking for errors Two
types ODD parity and EVEN parity EVEN parity
counts number of occurrences of 1s in the binary
string and then adds an extra bit set to 1 if
there are an even number (else it sets it to
0) ODD parity counts number of occurrences of 1s
in the binary string and then adds an extra bit
set to 1 if there are an odd number (else it sets
it to 0)
15
Binary Number Format
parity bit
sign bit
data bits
Now our 8-bit number can store the range of
numbers - 64 through to 63
16
Examples
  • In decimal what do the following even parity
    binary numbers represent?

17
Characters and Symbols(1)
ASCII American Standard for Information
Interchange These are represented by 8 bit even
parity code The format of the code is - 7 6 5
4 3 2 1 0
P
ZONE
NUMERIC
This indicates that the zone is 0 7 and the
numeric is 0 15(F)
18
Characters and Symbols(2)
  • all numerals lie in zone 3
  • upper case letters in zones 4 and 5
  • lower case in zones 6 and 7
  • zones 0 and 1 contain non printing characters
  • DEL is the only non printing character in zones 2
    to 7

19
ASCII TABLE
The following slide shows a condensed version of
the ASCII table The hex value for each of the
codes is the first digit is the top row value and
the second digit is the first column value. For
example N is 4E. Write down the characters for
the following.
Manchester United. (18 characters)
20
(No Transcript)
21
Examples
  • Translate the following into characters
  • 49 66 20 79 6F 75 20 63 61 6E 20 64 6F 20 74 68
    69 73 20
  • 74 68 65 20 65 78 61 6D 20 77 69 6C 6C 20 62 65
    20 65 61 73 79 2E
Write a Comment
User Comments (0)
About PowerShow.com