<?xml version="1.0" encoding="UTF-8"?>

<upm-export>
	<title>Enseignement de l&#039;informatique et du numérique au lycée Boissy d&#039;Anglas</title>
	<link>https://icn-isn-boissy.yj.fr/wp</link>
	<description></description>
	<pubDate>Wed May 6 11:51:11 2026 / +0000  GMT</pubDate>
	<generator>Universal Post Manager 1.1.2 [ www.ProfProjects.com ] </generator>
	<language></language>
	
			<item>
			<title>Codage - Exercices</title>
			<link>https://icn-isn-boissy.yj.fr/wp/?p=2456</link>
			<pubDate>Wed May 6 11:51:11 2026 / +0000  GMT</pubDate>
			<guid isPermaLink="false">https://icn-isn-boissy.yj.fr/wp/?p=2456</guid>
			<content-encoded><![CDATA[<!-- wp:heading -->
<h2 class="wp-block-heading"><strong>Exercice 1</strong></h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Ecrire une fonction <strong>decimal_vers_binaire()</strong> qui prend comme argument un nombre entier décimal saisi par l'utilisateur et qui renvoi le nombre binaire correspondant sur 1 octet (8bits).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>La fonction devra coder le nombre décimal en binaire et rajoutera le nombre de 0 voulu pour faire un octet.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Exemples : </strong></p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":2458,"sizeSlug":"large"} -->
<figure class="wp-block-image size-large"><img src="https://icn-isn-boissy.yj.fr/wp/wp-content/uploads/2020/01/image-1.png" alt="" class="wp-image-2458"/></figure>
<!-- /wp:image -->

<!-- wp:image {"id":2459,"sizeSlug":"large"} -->
<figure class="wp-block-image size-large"><img src="https://icn-isn-boissy.yj.fr/wp/wp-content/uploads/2020/01/image-2.png" alt="" class="wp-image-2459"/></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2 class="wp-block-heading"><strong>Exercice </strong>2</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Modifier la fonction précédente pour coder le nombre entier sur 16 bits.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Exemples :</strong></p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":2460,"sizeSlug":"large"} -->
<figure class="wp-block-image size-large"><img src="https://icn-isn-boissy.yj.fr/wp/wp-content/uploads/2020/01/image-3.png" alt="" class="wp-image-2460"/></figure>
<!-- /wp:image -->

<!-- wp:image {"id":2461,"sizeSlug":"large"} -->
<figure class="wp-block-image size-large"><img src="https://icn-isn-boissy.yj.fr/wp/wp-content/uploads/2020/01/image-4.png" alt="" class="wp-image-2461"/></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2 class="wp-block-heading"><strong>Exercice 3</strong></h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Ecrire une fonction  <strong>plus_un()</strong> qui ajoute 1 à un nombre binaire de 8 bits saisi par l'utilisateur passé en argument.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Exemples :</strong><br></p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":2463,"sizeSlug":"large"} -->
<figure class="wp-block-image size-large"><img src="https://icn-isn-boissy.yj.fr/wp/wp-content/uploads/2020/01/image-5.png" alt="" class="wp-image-2463"/></figure>
<!-- /wp:image -->

<!-- wp:image {"id":2464,"sizeSlug":"large"} -->
<figure class="wp-block-image size-large"><img src="https://icn-isn-boissy.yj.fr/wp/wp-content/uploads/2020/01/image-6.png" alt="" class="wp-image-2464"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Pour vous aiguiller :<br><strong>1-</strong> Recopier l'octet saisi par l'utilisateur dans une liste.<br><strong>2-</strong> Comparer chaque bit, rang par rang. Si le bit de rang 0 est égal à 1, le changer à 0 et marquer la retenue à Vraie. Si le bit de rang 0 est égal à 0, le changer à 1 et garder les autres intacts.<br><strong>3-</strong> Si la retenue est  Vraie tester les bit de rang suivant, les uns après les autres tant que la retenue est  Vraie.<br><strong>4-</strong> Recopie du résultat dans un string que l'on affichera en appelant la fonction <strong><em>plus_un()</em></strong></p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Exercice 4</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p> Ecrire un programme qui permet de convertir les nombres entiers  en binaire signé en complément à 2 (en 8 bits) . <br> <strong>1- </strong>Adapter la fonction  <strong>decimal_vers_binaire</strong> <strong>()</strong> de l'<em><strong>exercice 1</strong></em> afin de convertir le nombre binaire  en décimal (sur 7 bits). <br><strong>2-</strong> Créer une fonction <strong>inversion()</strong> qui prend en argument le nombre binaire convertit précédemment et renvoi le résultat d'une inversion bit à bit.<br><strong>3- </strong>Utiliser la fonction <strong>plus_un()</strong> de l'<strong><em>exercice 3</em></strong> avec comme argument le nombre binaire renvoyé par la fonction inversion() et renvoi le résultat de l'addition de ce dernier avec 1.<br>Enfin, imprimer à l'écran le résultat et vérifier la justesse de ce dernier.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>Exemples :</strong></p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":2466,"sizeSlug":"large","className":"is-style-default"} -->
<figure class="wp-block-image size-large is-style-default"><img src="https://icn-isn-boissy.yj.fr/wp/wp-content/uploads/2020/01/image-7.png" alt="" class="wp-image-2466"/></figure>
<!-- /wp:image -->

<!-- wp:image {"id":2467,"sizeSlug":"large"} -->
<figure class="wp-block-image size-large"><img src="https://icn-isn-boissy.yj.fr/wp/wp-content/uploads/2020/01/image-8.png" alt="" class="wp-image-2467"/></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2 class="wp-block-heading">Exercice 5</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><strong> NoteBook de correction</strong></p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p></p>
<!-- /wp:paragraph -->]]></content-encoded>
			<excerpt-encoded><![CDATA[]]></excerpt-encoded>
			<wp-post_id>2456</wp-post_id>
			<wp-post_date>2020-01-20 11:08:39</wp-post_date>
			<wp-post_date_gmt>2020-01-20 10:08:39</wp-post_date_gmt>
				</item>
</upm-export>
