Monash University · FACULTY OF COMPUTER SCIENCE

FIT1047 Chap.2 Signed Numbers, Floating Point and Character Encoding

- one subject, every graph, every model, every mark
11 Chapters9-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 2 of 14 · FIT1047

Signed Numbers, Floating Point and Character Encoding

The same bits can represent an unsigned integer, a signed integer, a floating-point value or text. This chapter makes width and scheme explicit before decoding. For two’s-complement values, it pairs invert-and-add-one with negative-high-weight evaluation and distinguishes signed overflow from unsigned carry-out. It then explains sign extension, safe narrowing and why changing width can change interpretation.

Floating point is introduced conceptually through sign, exponent and significand roles, normalisation, scale, precision and rounding—without inventing field sizes or bias rules for an unspecified standard. Character representation is separated into abstract character, numeric code, encoded units and rendered glyph.

The core diagnostic skill is classification: invalid syntax, wrong interpretation, range overflow, precision loss and decoding disagreement are different failures. All worked patterns are fresh Week 1-aligned practice, not live assessment content. The interpretation contract should be stated before arithmetic: bit pattern, width, representation scheme and requested output.

Independent decoding methods are valuable only when they rely on different structural decisions. For floating point, the chapter stays conceptual unless a storage format is explicitly supplied; for text, it distinguishes code identity from byte encoding and visual rendering. These are original Week 1-aligned explanations, not substitutes for any personalised A1 representation work.

In this chapter

What this chapter covers

  • 01

    Pattern, scheme and width

  • 02

    Two’s-complement encode/decode

  • 03

    Signed and unsigned overflow

  • 04

    Sign extension and truncation

  • 05

    Floating-point field roles

  • 06

    Binary scientific notation

  • 07

    Precision and rounding

  • 08

    Character codes, encodings and glyphs

  • 09

    Interpretation contracts for reused bit patterns

  • 10

    Decode-before and decode-after width checks

  • 11

    Separating code identity, encoded units and rendering

Worked example · free

AskSia-authored practice weighting (not an official mark scheme): Fresh signed representation trace

Q [4 marks]. AskSia-authored practice: encode negative 45 in eight-bit two’s complement, decode it by a second route, then explain how widening should work.
  • widthWrite positive 45 as 00101101 in eight positions.
  • encodeInvert to 11010010 and add one, producing 11010011.
  • verifyDecode with the negative-high-weight method to confirm −45.
  • extendSign-extend by repeating the leading one; decode the wider pattern to confirm unchanged value.
The eight-bit two’s-complement representation is 11010011. Valid sign extension repeats the leading one and preserves −45.
Sia tip — Carry the width beside every step. A negative-high-weight chosen for the wrong width changes the decoded value. After widening or narrowing, decode the result under the declared scheme and compare values. For character data, compare abstract codes and encoded units rather than trusting two glyphs that merely look alike.
Glossary

Key terms

Two’s complement
A fixed-width signed encoding whose leading-one patterns represent negative values under a negative high weight.
Sign extension
Widening a two’s-complement value by repeating its leading bit.
Signed overflow
A fixed-width condition where same-sign operands produce an opposite-sign stored result.
Significand
The floating-point field or concept carrying the precision digits.
Exponent
The floating-point scale component that shifts the binary radix point conceptually.
Encoding
A rule mapping abstract symbols or code points to stored/transmitted units.
Interpretation error
A failure caused by decoding a valid pattern under the wrong width or representation scheme. The bits may be intact while the inferred value is wrong. The repair is to restore the representation contract, not to alter the stored pattern.
Round-trip text check
A verification that follows an abstract character through its numeric code and encoded units and then decodes those units back. Comparing only rendered glyphs is weaker because fonts and visually similar characters can conceal different underlying codes.
FAQ

Signed Numbers, Floating Point and Character Encoding FAQ

Is the leading bit just an independent sign?

Not in two’s complement. Negation inverts the entire field and adds one; flipping only the leading bit generally does not negate the value.

Why is carry-out not the signed-overflow rule?

Carry-out answers an unsigned range question. Signed overflow is detected from operand and result signs because the same low bits have a different signed interpretation.

Why can floating-point calculations differ from real arithmetic?

A finite significand cannot retain every real value. Rounding, scale differences and cancellation can produce approximations even when the mathematical operation is exact.

Is a displayed character stored as its shape?

No. Systems store encoded units that map to abstract characters; fonts and rendering determine appearance. Wrong decoding can map valid bytes to different characters.

What is a strong representation answer?

State scheme and width, show the decoding rule, separate exact mathematical value from stored result, name overflow or rounding correctly and verify through an independent route.

Why must width be named when interpreting two's-complement data?

The highest position carries the negative weight defined by that width, and widening requires sign extension to preserve value. Reading the same visible suffix under a different field width can therefore produce a different interpretation.

What can safely be claimed about floating point without a named format?

You can explain the conceptual roles of sign, scale, significand, normalisation, limited precision and rounding. You should not invent field sizes, bias values, exceptional encodings or exact ranges when the applicable storage standard has not been specified.

Study strategy

Assessment move

Maintain a five-column table: pattern, scheme/width, decoded value, exact operation result and stored result. Encode and decode every negative practice value by two routes. Create same-sign arithmetic pairs that fit and overflow, then opposite-sign pairs that cannot cross both endpoints. Practise sign extension and prove value preservation; practise narrowing only with a decode-before/decode-after check.

For floating point, normalise binary values and discuss which information controls sign, scale and precision without assuming an unstated storage standard. For text, trace character → code → encoded units → rendered glyph and use round-trip tests. When a mismatch occurs, label it as interpretation, range, precision or encoding before repairing it.

Add a comparison drill where the same leading-one and leading-zero patterns are ordered once as unsigned and once as two’s complement. Explain why the relationship changes. For arithmetic, record mathematical operands, encoded operands, low field, decoded stored result and overflow judgement; then widen both operands correctly and repeat to show that overflow depends on width.

For floating point, keep an error ledger with exact value, normalised form, retained digits, discarded suffix and approximation direction. Compare truncation and rounding conceptually without inventing a named format's field layout. For characters, include empty text, one code-point boundary and two visually similar characters; log abstract codes and encoded units rather than trusting appearance.

Finish each practice session by classifying every failure: syntax, interpretation, range, precision, framing or rendering. This diagnosis-first habit prevents the unhelpful statement that a computer “misread a number” and prepares you to explain registers and protocol fields precisely.

Keep a source boundary beside the representation ledger: Week 1 supports the topic and A1 purpose, while each practice pattern here is newly authored. Use the course-developed text to verify terminology and scope, not as material to reproduce; never copy its tables, figures, code fragments or worked answers.

Working through Signed Numbers, Floating Point and Character Encoding in FIT1047? Sia is AskSia’s AI Computer Science tutor — ask any FIT1047 Signed Numbers, Floating Point and Character Encoding question and get a clear, step-by-step explanation grounded in how FIT1047 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 40 of your Monash University subjects - and 1,000+ Bibles across every Australian university.
Sia - your FIT1047 tutor, unlimited, worked the way the exam marks it
The full 9-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works
FIT1047 · Introduction to Computer Systems, Networks and Security - independent study guide on the AskSia Library. More Monash University subjects · Microeconomics across all universities
Unlock the full FIT1047 Bible + 40 Monash University subjects
$0.99 Trial