CPU

and a short introduction do processors

GPU

vs

WHY a GPU ?

The initial idea of GPUs was to share the load of the main processor

GPUs evolved to excel on the repetitive and block tasks

GPGPU

General-purpose computing on graphics processing units

GPU

CPU

9.6 x faster !

CPUs and GPUs work basically the same way, using different architectures

But How does a CPU WORKs ?

a really quick introduction

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

 

1 1 1 1 1 1 1 1 → 255

8 bit

0 → 0

1 → 1

10 → 2

11 → 3

100 → 4

101 → 5

8bit → 2⁸ → 256

9bit → 2⁹ → 512

10bit → 2¹⁰ → 1024

16bit → 2¹⁶ → 65536

32bit → 2³² → 4294967296

64bit →  2⁶⁴ → 9223372036854775808

The transistor

AND GATE

OR GATE

addition

0

1

0

0

+

0

1

0

1

0

1

+

1

0

Half adder

The half adder adds two single binary digits A and B. It has two outputs, sum (S) and carry (C).

A B C S
0 0 0 0
0 1 0 1
1 0 0 1
1 1 1 0

Full adder

Memory

Reading

10011

Reading

CPU

10011

Reading

CPU

10011

01001

Reading

CPU

Writing

00101

Writing

CPU

00101

11010

Writing

CPU

00101

11010

Writing

CPU

Data on RAM

  • Values (numbers, letters etc)
  • Addresses (RAM or devices)
  • Instructions (load, add, store, jump etc)

Inside the CPU

A

B

inputs

A

B

inputs

RAM

instruction

type of

operation

A

B

inputs

RAM

instruction

type of

operation

A

B

inputs

RAM

instruction

type of

operation

flags

A

B

inputs

RAM

instruction

type of

operation

flags

Instructions & ARCHITECTURES

Regardless of manufacturer or model, processors need to be able to understand the same set of instructions

architectures

micro-architecture - x86

x86

x86-64

ARM

SIMD

Instruction sets - x86

So, What's the difference between CPU and GPU ?

Instruction sets aren't exactly the same. GPUs evolved for graphics and they have, for example, clear instructions for repetitive matrices operations. 

CPUs, on the other hand, are able to better handle more complex sets of instructions, using bigger registers and RAM

CONTROL UNIT

ALU

REGISTER & CACHE

CPU

GPU

nVidia Tesla M40

CPU CHART

GPU

GTX 1080

CPU

intel i7

thanks for your attention !

CPUs vs GPUs

By Felipe Delestro