Giter VIP home page Giter VIP logo

sprint-challenge--computer-architecture's Introduction

Sprint-Challenge--Computer-Architecture

Binary, Decimal, and Hex

Complete the following problems:

  • Convert 11001111 binary

    • 1100 === 12 Decimal && 1111 === 15 Decimal

      12 = 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 hex

    4 = 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 decimal

    68

    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

Architecture

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.

Coding

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:

See the LS-8 spec for details

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

sprint-challenge--computer-architecture's People

Contributors

beejjorgensen avatar cosmonautjones avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.