Complete the following problems:
-
Convert
11001111
binary-
1100
=== 12 Decimal &&1111
=== 15 Decimal12 = C 15 = F
to hex:
CF
128 64 32 16 8 4 2 1 V V V V V V V V
1 1 0 0 1 1 1 1
128 + 64 + 8 + 4 + 2 + 1 = 207 to decimal: 207 -
-
Convert
4C
hex4 = 0100; C = 12 = 1100;
to binary:
01001100
128 64 32 16 8 4 2 1 V V V V V V V V
0 1 0 0 1 1 0 0
64 + 8 + 4 = 76 Decimal to decimal:
76
-
Convert
68
decimal68
128 64 32 16 8 4 2 1 V V V V V V V V
0 1 0 0 0 1 0 0
to binary:0100
0100
4
4
to hex:
44
One paragraph-ish:
-
Explain how the CPU provides concurrency:
- The CPU reads the instructions it's provided and is able to perform the program associated with the action in a order. It is able to be multiprocessing to perform parallel actions and multitask without having to wait for other instructions to finish.
-
Describe assembly language and machine language:
- Assembly language contains the same instructions as a machine language, but the instructions and variables have names instead of being just numbers. Programs written in high-level languages are translated into assembly language or machine language by a compiler. Assembly language is converted into executable machine code by a utility program referred to as an assembler.
-
Suggest the role that graphics cards play in machine learning:
- GPU provides a more powerful and efficient parallel computing. A single GPU might have thousands of cores while a CPU usually has no more than 12 cores. Although GPU cores are slower than CPU cores, they more than make up for that with their large number and faster memory if the operations can be parallelized. Sequential code is still faster on CPUs.
Options for submission, whichever is easier for you:
- Copy your source into this repo, or...
- Submit a PR for the Sprint Challenge from the
Computer-Architecture-One
repo you've been using all along.
Sprint Challenge:
Add the CMP
instruction and equal
flag to your LS-8.
Add the JMP
instruction.
Add the JEQ
and JNE
instructions.
Here is some code that exercises the above instructions. It should print 1, then 4, then 5.
00000100 # LDI R0,10
00000000
00001010
00000100 # LDI R1,20
00000001
00010100
00010110 # CMP R0,R1
00000000
00000001
00000100 # LDI R2,TEST1
00000010
00010011
00010011 # JEQ R2
00000010
00000100 # LDI R3,1
00000011
00000001
00000110 # PRN R3
00000011
# TEST1 (19):
00010110 # CMP R0,R1
00000000
00000001
00000100 # LDI R2,TEST2
00000010
00100000
00010100 # JNE R2
00000010
00000100 # LDI R3,2
00000011
00000010
00000110 # PRN R3
00000011
# TEST2 (32):
00000100 # LDI R1,10
00000001
00001010
00010110 # CMP R0,R1
00000000
00000001
00000100 # LDI R2,TEST3
00000010
00110000
00010011 # JEQ R2
00000010
00000100 # LDI R3,3
00000011
00000011
00000110 # PRN R3
00000011
# TEST3 (48):
00010110 # CMP R0,R1
00000000
00000001
00000100 # LDI R2,TEST4
00000010
00111101
00010100 # JNE R2
00000010
00000100 # LDI R3,4
00000011
00000100
00000110 # PRN R3
00000011
# TEST4 (61):
00000100 # LDI R3,5
00000011
00000101
00000110 # PRN R3
00000011
00011011 # HLT