CS241 Lecture Notes - Lecture 1: Nibble

44 views3 pages
Sequential Program
- In a sequence
- Not doing mutliple things in parallel (not at the same time)
- A single threaded program
Goal
- Understand how sequential programs work
- How is this program running?
- Describe the relationship between high level programming languages and machine level
data representation
This course talks about different abstractions.
Computers understand machine language which is binary and can be tedious to write so...
We abstract over it assembly language and use tool to translate between them.
Assembly is also tedious so we write some higher level of abstraction (like C, C++, Java, Racket
all higher-level languages).
We can translate from high level to assembly (compiler) and then to machine (assembler) or we
can go directly from high level to machine (compiler).
You will get to write programs that read programs and output programs.
Data Representations
How is data actually represented in a machine?
- bit: smallest representation of data (a single digit in binary - 0/1)
- byte: a sequence of 8 bits
- word: it is machine specific/dependent (size depends on machine), a sequence of bits (in
this course it'll be mostly 32 bits or 4 bytes)
- nibble: half a byte or 4 bits
example string - 1000011 - What could this mean?
- -3 (signed binary)
- one million eleven (decimal representation)
- 67 (unsigned binary)
- -61 (2's complement number - another signed binary form)
- C (ASCII upper case c)
- garbage
Decimal Representation (powers of 10)
1000011 - 1x10^6 + 1x10^1 + 1x10^0
Binary Representation (powers of 2 - unsigned)
1000011 - 1x2^6 + 1x2^1 + 1x2^0 = 67
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows page 1 of the document.
Unlock all 3 pages and 3 million more documents.

Already have an account? Log in

Document Summary

Not doing mutliple things in parallel (not at the same time) Describe the relationship between high level programming languages and machine level data representation. Computers understand machine language which is binary and can be tedious to write so We abstract over it assembly language and use tool to translate between them. Assembly is also tedious so we write some higher level of abstraction (like c, c++, java, racket all higher-level languages). We can translate from high level to assembly (compiler) and then to machine (assembler) or we can go directly from high level to machine (compiler). You will get to write programs that read programs and output programs. Bit: smallest representation of data (a single digit in binary - 0/1) Word: it is machine specific/dependent (size depends on machine), a sequence of bits (in this course it"ll be mostly 32 bits or 4 bytes) 61 (2"s complement number - another signed binary form)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents