## Resources

1. Web Assembly docs
2. Learn hexidecimal
3. Gem's website

## Binary Overview

This section simply talks over the simplicity of 1s and 0s being the powerhouses behind the technologies that we use today.

This overview speaks to binary, what bytes are and how the counting works in the base two system.

## Endianness

When computes intepret instructions, they need to know the byte order known as endianness. Little endian is right-to-left, but we might also read in ascending order (big endian).

The formatting can depend on the computer architecture.

Most modern computers use little endian.

## Which is little endian for 1?

Select one answer

## Web Assembly docs

A link to the docs for memory instructions can be found here. That being said, it is mentioned that you will not often go here.

This is more important if you are a micro-architecture engineer.

## Hexadecimal

The phrase machine code is often used when describing low-level programming. Hex is the lowest form of "human-readable" format that we can program in.

The example given is 0x2E7 which can be calculated like so:

Math block

$743 = (256 * 2) + (16 * 14) + (1 * 7)$

A great website for understanding Hexadecimal.

## Convert Hex & Binary to string

We can use our toString() method.

.css-e69dqy{position:relative;z-index:0;}.css-qq5p7o{padding:var(--chakra-space-5);border-radius:8px;margin-top:var(--chakra-space-8);margin-bottom:var(--chakra-space-8);background:#011627;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;overflow:hidden;}Object.prototype.toString(radix).css-cziimd{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:absolute;white-space:nowrap;vertical-align:middle;outline:2px solid transparent;outline-offset:2px;width:auto;line-height:1.2;border-radius:var(--chakra-radii-md);font-weight:var(--chakra-fontWeights-semibold);transition-property:var(--chakra-transition-property-common);transition-duration:var(--chakra-transition-duration-normal);height:24px;min-width:var(--chakra-sizes-8);font-size:var(--chakra-fontSizes-xs);-webkit-padding-start:var(--chakra-space-3);padding-inline-start:var(--chakra-space-3);-webkit-padding-end:var(--chakra-space-3);padding-inline-end:var(--chakra-space-3);background:var(--chakra-colors-teal-500);color:var(--chakra-colors-white);text-transform:uppercase;top:var(--chakra-space-4);z-index:1;right:1.25em;}.css-cziimd:focus,.css-cziimd[data-focus]{box-shadow:var(--chakra-shadows-outline);}.css-cziimd[disabled],.css-cziimd[aria-disabled=true],.css-cziimd[data-disabled]{opacity:0.4;cursor:not-allowed;box-shadow:var(--chakra-shadows-none);}.css-cziimd:hover,.css-cziimd[data-hover]{background:var(--chakra-colors-teal-600);}.css-cziimd:hover[disabled],.css-cziimd[data-hover][disabled],.css-cziimd:hover[aria-disabled=true],.css-cziimd[data-hover][aria-disabled=true],.css-cziimd:hover[data-disabled],.css-cziimd[data-hover][data-disabled]{background:var(--chakra-colors-teal-500);}.css-cziimd:active,.css-cziimd[data-active]{background:var(--chakra-colors-teal-700);}

Radix refers to the base.

Radix/BaseType
2binary
10decimal
16hexidecimal
function hexToDecimal(hex) {
return hex.toString(16)
}

// hexToDecimal(0x2e7)

function decimalToBinary(decimal) {
return decimal.toString(2)
}
// decimalToBinary(22)

## Memory

The ability to store these 1s and 0s in state. There is long-term and short-term memory.

I skipped over notes for this section as it was more of a repeat from uni.

## Numeric Types

This is a review on different forms.

TypeExample
Floating Point142.24
Integer123
Unsigned Int123 (gives back signed bit for space

Under the hood, all numbers in javaascript are 64-bit floating points whereas Web Assembly are all memory pointers of 32-bit.

## Repository

https://github.com/okeeffed/developer-notes-nextjs/content/web-assembly/1-web-assembly-basics