πŸ“–
Wiki
CNCFSkywardAIHuggingFaceLinkedInKaggleMedium
  • Home
    • πŸš€About
  • πŸ‘©β€πŸ’»πŸ‘©Freesoftware
    • πŸ‰The GNU Hurd
      • πŸ˜„The files extension
      • πŸ“½οΈTutorial for starting
      • 🚚Continue Working for the Hurd
      • πŸš΄β€β™‚οΈcgo
        • πŸ‘―β€β™€οΈStatically VS Dynamically binding
        • 🧌Different ways in binding
        • πŸ‘¨β€πŸ’»Segfault
      • πŸ›ƒRust FFI
    • πŸ§šπŸ»β€β™‚οΈProgramming
      • πŸ“–Introduction to programming
      • πŸ“–Mutable Value Semantics
      • πŸ“–Linked List
      • πŸ“–Rust
        • πŸ“–Keyword dyn
        • πŸ“–Tonic framework
        • πŸ“–Tokio
        • πŸ“–Rust read files
  • πŸ›€οΈAI techniques
    • πŸ—„οΈframework
      • 🧷pytorch
      • πŸ““Time components
      • πŸ““burn
    • 🍑Adaptation
      • 🎁LoRA
        • ℹ️Matrix Factorization
        • πŸ“€SVD
          • ✝️Distillation of SVD
          • 🦎Eigenvalues of a covariance matrix
            • 🧧Eigenvalues
            • πŸͺCovariance Matrix
        • πŸ›«Checkpoint
      • 🎨PEFT
    • πŸ™‹β€β™‚οΈTraining
      • πŸ›»Training with QLoRA
      • 🦌Deep Speed
    • 🧠Stable Diffusion
      • πŸ€‘Stable Diffusion model
      • πŸ“ΌStable Diffusion v1 vs v2
      • πŸ€Όβ€β™€οΈThe important parameters for stunning AI image
      • ⚾Diffusion in image
      • 🚬Classifier Free Guidance
      • ⚜️Denoising strength
      • πŸ‘·Stable Diffusion workflow
      • πŸ“™LoRA(Stable Diffusion)
      • πŸ—ΊοΈDepth maps
      • πŸ“‹CLIP
      • βš•οΈEmbeddings
      • πŸ• VAE
      • πŸ’₯Conditioning
      • 🍁Diffusion sampling/samplers
      • πŸ₯ Prompt
      • πŸ˜„ControlNet
        • πŸͺ‘Settings Explained
        • 🐳ControlNet with models
    • πŸ¦™Large Language Model
      • ☺️SMID
      • πŸ‘¨β€πŸŒΎARM NEON
      • 🍊Metal
      • 🏁BLAS
      • πŸ‰ggml
      • πŸ’»llama.cpp
      • 🎞️Measuring model quality
      • πŸ₯žType for NNC
      • πŸ₯žToken
      • πŸ€Όβ€β™‚οΈDoc Retrieval && QA with LLMs
      • Hallucination(AI)
    • 🐹diffusers
      • πŸ’ͺDeconstruct the Stable Diffusion pipeline
  • 🎹Implementing
    • πŸ‘¨β€πŸ’»diffusers
      • πŸ“–The Annotated Diffusion Model
  • 🧩Trending
    • πŸ“–Trending
      • πŸ“–Vector database
      • 🍎Programming Languages
        • πŸ“–Go & Rust manage their memories
        • πŸ“–Performance of Rust and Python
        • πŸ“–Rust ownership and borrowing
      • πŸ“–Neural Network
        • 🎹Sliding window/convolutional filter
      • Quantum Machine Learning
  • 🎾Courses Collection
    • πŸ“–Courses Collection
      • πŸ“šAcademic In IT
        • πŸ“Reflective Writing
      • πŸ“–UCB
        • πŸ“–CS 61A
          • πŸ“–Computer Science
          • πŸ“–Scheme
          • πŸ“–Python
          • πŸ“–Data Abstraction
          • πŸ“–Object-Oriented Programming
          • πŸ“–Interpreters
          • πŸ“–Streams
      • 🍎MIT Algorithm Courses
        • 0️MIT 18.01
          • 0️Limits and continuity
          • 1️Derivatives
          • 3️Integrals
        • 1️MIT 6.042J
          • πŸ”’Number Theory
          • πŸ“ŠGraph Theory
            • 🌴Graph and Trees
            • 🌲Shortest Paths and Minimum Spanning Trees
        • 2️MIT 6.006
          • Intro and asymptotic notation
          • Sorting and Trees
            • Sorting
            • Trees
          • Hashing
          • Graphs
          • Shortest Paths
          • Dynamic Programming
          • Advanced
        • 3️MIT 6.046J
          • Divide and conquer
          • Dynamic programming
          • Greedy algorithms
          • Graph algorithms
Powered by GitBook
On this page
  • Overview
  • Bits and Bytes
  • Hexadecimal Notation
  • Memory Map
  • Registers
  • Accumulators
  • Index registers
  • Machine Code VS Assembly Language
  • Machine Code
  • Signed and Unsigned Binary Numbers
  • Unsigned Binary Numbers
  • Signed Binary Numbers

Was this helpful?

Edit on GitHub
  1. πŸ‘©Freesoftware
  2. Programming

Introduction to programming

PreviousProgrammingNextMutable Value Semantics

Last updated 1 year ago

Was this helpful?

Overview

This article is picked from the article .

Bits and Bytes

In computers, information is represented with voltages, and it is most convenitent for he voltage level to represebt only two states:

  • A binary one or binary zero

Thus computers process binary digits, or bits. For example, in an 8-bit numeral, 256 different states can be represented, since

28=2562^8 = 25628=256

Programmers use these 256 states to represent different things, like:

  • a natural number from 0 to 255;

  • an interger in the range of -128 to 127;

  • a character of data(a letter, number, or printable symbol);

When programmers need to represent larger numberal, they group bytes together. A common grouping is two bytes, often called a 16-bit word, or a short(a "regular" word is 4 bytes of data). A word can have 65536 sattes, since

216=655362^16 = 65536216=65536

Hexadecimal Notation

Decimal numbers are painful to use when talking about binary information. To make life easier, programmers started to use the base 16 hexadecimal(hex for short) numbering system whne taling about bits, bytes, and other binary data.

Hexadecimal numbers are written using the digits 0 through 9 and the letters A through F. The letters A through F represent the decimal numbers 10 through 15, respectively.

binary
decimal
hex

0b000

0

0x0

0b001

1

0x1

0b010

2

0x2

0b011

3

0x3

0b100

4

0x4

0b101

5

0x5

0b110

6

0x6

0b111

7

0x7

0b1000

8

0x8

0b1001

9

0x9

0b1010

10

0xA

0b1011

11

0xB

0b1100

12

0xC

0b1101

13

0xD

0b1110

14

0xE

0b1111

15

0xF

0b10000

16

0x10

According to table above, we can see that Binary numbers are represented by the prefix 0b. Hexadecimal numbers are represented by the prefix 0x. Decimal numbers are represented by no prefix.

Memory Map

Memory is oraganized as a contiguous string of addresses, or locations. The entire amount of memory that a processor can access is called its address space.

Registers

A microprocessor does its work by moving data from memory into its internal registers, processing on it, and then copying it back into memory. There are two different types of registers:

Accumulators

Accumulators are used to perform most arithmetic operations

Index registers

Index registers are used to point at data that is located in memory

Machine Code VS Assembly Language

Both of these terms refer to the same thing: the program that is executed directly by the microprocessor

Machine Code

Machine code usually refres to the raw data stored as microprocessor's program. This is commonly described in the hexadecimal notation we've been using.

Assembly language is a set of mnemonics, or names, and a notation that is a readable yet efficient wat of writing down the machine instructions. Usually, a program taht is written in assembly language is processed by an assembler program, that converts the mnemonic instructions into machine code. The output from the assembler program is often called the object code, which can then executed directly by the microprocessor.

Signed and Unsigned Binary Numbers

There are methods of representing binary numbers that are commonly used by microprocessors.

Unsigned Binary Numbers

The unsigned format is used to represent numbers in the range of 0 to 255 or 0 to 65535(one word of data). But, the unsgined format has the limitation that values less than zero cannot be represented.

Signed Binary Numbers

The signed format is used to represent numbers in the range of -128 to 127 or -32768 to 32767(one word of data). The signed format has the limitation that values greater than 127 or 32767 cannot be represented.

πŸ‘©β€πŸ’»
πŸ§šπŸ»β€β™‚οΈ
πŸ“–
Introduction to 6811 programming