Data Representations

Kinds Of Things Digital Computers Must Represent

Types of Numeric Data

Numeric Data Types in Java

N-bit Integer Representations

Example: 4-bit Unsigned Integers

Example: 4-bit Signed-magnitude Integers

Example: 4-bit Two’s-complement Integers

Converting A Decimal Value N To Two’s-complement Representation

Example: Convert Decimal 43 And
–43 To Java Byte Values

Example: Convert Decimal 43 And
–43 To Java Byte Values (Cont’d)

What Changes Among Java Integer Types?

Representing Floating-point Values

Floating-point Fields

Example: Represent Decimal 1.75 As A Java Float