Skip to content

Meeting Summary: CS 631-01 Systems Foundations

Date: February 17, 2026
Time: 08:12 AM Pacific Time (US and Canada)
Meeting ID: 870 0988 0761


Quick Recap

The session focused on binary representation, number bases, and two’s complement in the context of the NTLANG project. Greg explained:

  • How to convert between binary, decimal, and hexadecimal representations.
  • How bitwise operations and shifts work in both C and Rust.
  • Differences between C and Rust regarding signed/unsigned integers and explicit type casting in Rust.

The class will continue implementing evaluation for NTLANG, including parsing expressions, handling variables, and extending the language to support scripts. Greg emphasized that mastering these foundational concepts is essential for upcoming project work.


Next Steps

  • Greg: Send a spreadsheet for students to provide their GitHub IDs (today).
  • Students: Populate the spreadsheet with GitHub IDs upon receipt.
  • Greg: Post the Project 1 specification (today).
  • Greg: Grade Lab 1 and Lab 2 (Lab 1 first; Lab 2 likely by tomorrow).
  • Students: Ensure Lab 2 runs on the Beagles and submit to GitHub by 11:59 PM tonight.
  • Greg: Post lecture notes for Thursday’s session.
  • Greg: Respond to Joon’s email regarding career matters.

Summary of Topics

1) Lab Assignments and Project Specifications

  • Lab 2 is due at 11:59 PM and requires GitHub IDs submitted via the provided spreadsheet.
  • Project 1 will add evaluation capabilities to NTLANG, including:
  • Operator precedence in EB&F.
  • Extension of NT-Lang to support variables and scripts.
  • Implementation of an environment for variable bindings.
  • Greg will post the Project 1 spec and cover evaluation details in the next class.

2) Number Base Conversion

  • Conversions among decimal, binary, and hexadecimal were reviewed using:
  • Positional-value methods.
  • Remainder/division methods.
  • Key points:
  • Humans often convert hex ↔ binary directly; computers operate on normalized integer forms.
  • Emphasis on representing and manipulating 32-bit integers in NT-Lang.

3) Two’s Complement Representation

  • Motivation:
  • Avoids separate positive and negative zeros required by sign-magnitude representations.
  • Enables efficient hardware by using a single zero and extending the negative range.
  • Conversions:
  • Positive → negative: invert bits and add 1.
  • Negative → positive: invert bits and add 1.
  • Arithmetic:
  • Standard addition works unchanged; hardware uses grade-school addition logic.
  • Bit-size changes:
  • Sign extension preserves value when increasing bit width.
  • Ranges:
  • For N-bit two’s complement: −2^(N−1) to 2^(N−1) − 1.

4) Bitwise Operations and Shifts

  • Operations: AND, OR, XOR — used to construct and manipulate bit patterns.
  • Masking:
  • Use bitwise AND to extract specific bits from larger values.
  • Shifts:
  • Logical shifts (left/right): fill with zeros; useful for multiply/divide by powers of two.
  • Arithmetic right shift: preserves the sign bit for signed values.
  • Relevance:
  • Essential for upcoming work, including a RISC-V machine code emulator.
  • NT-Lang supports these bitwise operations.

5) Language-Specific Details (C vs. Rust)

  • Signed vs. unsigned integers:
  • Understanding representation and behavior is critical for correct conversions and operations.
  • Type casting:
  • Rust requires explicit casts and is more strict about types, reducing undefined behavior compared to C.
  • Continued discussion on these differences will follow in the next session.
  • Reminder: Students should submit their product lab to GitHub if not already submitted.

End of summary.