This is an old revision of the document!
An integer is a number that has no fractional component, so 2, 6, -15, and 17356 are all considered integers, while 13½, -1/12, π, and 5.2 are not. For our use, we split integers into 2 categories, signed and unsigned. A signed integer is any whole number, negative or positive, while an unsigned integer is a strictly positive whole number (and zero).
In this project we are looking at 10 different types of data values, that are all variations of integers with different byte sizes:
signed long long int --- 16 bytes unsigned long long int --- 16 bytes signed long int --- 8 bytes unsigned long int --- 8 bytes signed int --- 4 bytes unsigned int --- 4 bytes signed half int --- 2 bytes unsigned half int --- 2 bytes signed char --- 1 byte unsigned char --- 1 byte
As you can see they follow the pattern of long doubling, and half, halving, the exception is character, which is essentially a half half integer, in fact it would be abbreviated as either hhd or hhu depending on its signing.
Each of the data value types has an associated size, ranging from 1 byte (8 bits) to 32 byte (256 bits), so the length of the number in binary will be given based on the type. For example:
unsigned int: 4 bytes 0000000000000000000000000000000 unsigned half int: 2 bytes 0000000000000000
Whether or not the data type is signed changes how the first bit of the number interacts with the rest, in a signed number the first bit acts as a positive or negative sign For example:
signed half half int 1 Byte Binary: 10000000 Decimal: -128 Binary: 00000000 Decimal: 0
For further information on how negative act in binary try looking here:
https://en.wikipedia.org/wiki/Two%27s_complement
Each place value in binary is worth double the previous
Ex: 1 1 1 1 Is worth 8 4 2 1
To convert a binary number to decimal, just add each place value Ex:
11010010 (1*128)+(1*64)+(0*32)+(1*16)+(0*8)+(0*4)+(1*2)+(0*1) =210
An AND logic gate inputs or conditions need to be either both met or not met to work.
EXAMPLE- To login you need both a valid email and password;
(Valid email)------- | |--[AND]--(No login) | (Invalid password)-- Binary view of previous; ( 1 ) -------------- | |--[AND]--( 0 ) | ( 0 ) --------------
AND gate turned on
( 1 ) -------------- | |--[AND]--( 1 ) | ( 1 ) -------------- ( 0 ) -------------- | |--[AND]--( 1 ) | ( 0 ) --------------
List of all AND gate Interactions