top of page
Rechercher

Projet 2

  • lilian0305060
  • 6 oct. 2022
  • 1 min de lecture

Corrigez ce programme ci-dessous pour avoir l'addition des nombres binaires

01010001

00110011


n = []

p = []

r = []


c = False

for i in range():

a = n[i]

b = p[i]

unite = (a and not(b) and not(c)) or\

(not(a) and b and not(c)) or\

(not(a) and not(b) and c) or\

(a and b and c)

r = [int(unite)] + r

c = (a and b) or (b and c) or (a and c)

r = +r


print(r)


a = "01010001"

b = "00110011"


sum = bin(int(a, 2) + int(b, 2))


print(sum[2:])

print (sum)

 
 
 

Posts récents

Voir tout
Correction Exercices :

Exercice 1: Réponse B: E en binaire = 1110 et D en binaire = 1101 Exercice 2: Réponse C: 15 en bianire = 1111 (voir tableau) Exercice 3:...

 
 
 

Comentários


Bonjour et merci pour votre visite !

Paragraphe. Cliquez ici pour ajouter votre propre texte. Utilisez cet espace pour relater votre parcours et présenter votre activité à vos visiteurs.

Pour recevoir
toute mon actu

Merci pour votre envoi

  • Facebook
  • Instagram
  • Twitter
  • Pinterest
bottom of page